-
Notifications
You must be signed in to change notification settings - Fork 31
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Upgrade app structure #41
Upgrade app structure #41
Conversation
Proposals is a component in the screens folder, separated from the App file, and recieves `proposals` and `selectProposal` as props from the App component.
App logic passes function hooks to whoever calls it, such as `selectProposal` or `isSyncing`.
Major change in the component, that now renders the proposals using the `Proposals` component, and passes functions to its components via the appLogic hook. There were some UI updates such as Header, that is simpler and mobile friendly.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The code looks very well. When you finish I test it and review it again.
If there are no proposals made, then the app will render this.
When a proposal is selected, a proposal detail page opens with the details from that proposal.
App now works in a different logic - according to the hooks state, selectedProposal and proposals.
This logic is passed to App and it's child components via props, if necessary.
…onal All components are dummy components, only rendering data that is passed to them.
Components, state and logic are only rendered and passed through here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for moving this forward Viviane. It's great to see how this repo is having activity again!!
}) | ||
const [isDisabled, setStatus] = useState(true) | ||
|
||
const isFormValid = form => form.filter(i => i === '' || i === 0).length === 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should only consider required fields here.
<Field label="Description"> | ||
<TextInput | ||
onChange={event => | ||
setForm({ ...form, description: event.target.value }) | ||
} | ||
value={form.description} | ||
wide | ||
multiline | ||
/> | ||
</Field> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can't store proposal descriptions yet (as they should be stored and pinned on IPFS, and we are not ready for that). I would remove this field for now.
app/src/screens/ProposalDetail.js
Outdated
<div> | ||
<H2 color={theme.surfaceContentSecondary}>Description</H2> | ||
<Text | ||
css={` | ||
${textStyle('body2')}; | ||
`} | ||
> | ||
{description || DEFAULT_DESCRIPTION} | ||
</Text> | ||
</div> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's not display descriptions for now.
app/src/screens/Proposals.js
Outdated
${textStyle('body3')}; | ||
`} | ||
> | ||
{description.slice(0, 29) + '...'} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would not show description in the table, as we want to empathize the title.
cb2fcdb
to
7504b8d
Compare
Thanks @vivianedias! @PJColombo and me have reviewed it today, and that's fantastic! |
Update app structure to use hooks and add dark mode feature.
proposals/{$id}
, so if this link would be shared later, the user would be redirected to this specific proposal.