IBM / ipfs-social-proof

IPFS Social Proof: A decentralized identity and social proof system
MIT License
142 stars 27 forks source link

Idui component #24

Closed tyleryasaka closed 5 years ago

tyleryasaka commented 5 years ago

Creates a separate IdUI component, modeled after the public-key-card component.

I didn't implement a doWork method because it wasn't needed for this component (and I actually don't think it needs to exist in any components). In the functional paradigm, which I am a big supporter of, the data is passed down into the components, and the component fires actions up to its parents. The component modifies itself via its internal state. doWork in this context is vague and seems to imply a pattern of side effects, where a function/component modifies something outside of itself.

Really, then, to be completely functional, the components should simply be returning html, not actually doing the DOM update. I'm thinking something like choo would make sense here. Anyways, that's out of scope for this PR, just noting these thoughts while I'm at it.

Made a couple minor tweaks as well:

daviddahl commented 5 years ago

Agreed on all points. doWork was merely a way to isolate operstions away from render or setState as much as possible.

Awesome! I will review today - asap.