Skip to content
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

Functional proposal details #2449

Merged
merged 8 commits into from
Apr 10, 2020
Merged

Conversation

vctt94
Copy link
Member

@vctt94 vctt94 commented Mar 26, 2020

This PR depends on #2448.

It makes proposal details a functional component. With that we can remove our proposal connectors

@vctt94 vctt94 force-pushed the functoinal-proposal-details branch 2 times, most recently from fdd13d4 to d4c590b Compare April 6, 2020 16:06
@vctt94 vctt94 changed the title Functoinal proposal details Functional proposal details Apr 6, 2020
@vctt94 vctt94 force-pushed the functoinal-proposal-details branch from d4c590b to 3538fa6 Compare April 6, 2020 18:31
Copy link
Member

@amass01 amass01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vctt94 nice work mate!
Added some small suggestions, mainly to declare components as arrow functions and use destruction for props when declaring a functional components which should improve the readability slightly.

app/components/modals/Modal.js Outdated Show resolved Hide resolved
app/components/modals/Modal.js Outdated Show resolved Hide resolved
}
}

function ChooseVoteOption({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
function ChooseVoteOption({
const ChooseVoteOption = ({...}) =>

Copy link
Member Author

@vctt94 vctt94 Apr 9, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here, as it is a component, I'd rather let it as function. Otherwise, as an arrow function it does not show at the stack trace, when erroring, which makes debug harder.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see, makes sense

Copy link
Member

@amass01 amass01 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

eligibleTicketCount,currentVoteChoice, showPurchaseTicketsPage
}) => {
// getVoteInfo is an auxiliar function to get the properly vote info component.
function getVoteInfo () {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

arrow function ?

/>
);}

function getError(error) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about here ?

@vctt94 vctt94 force-pushed the functoinal-proposal-details branch from 54407c5 to 0d921f2 Compare April 9, 2020 16:11
@vctt94
Copy link
Member Author

vctt94 commented Apr 9, 2020

Changed. Thanks for reviewing

@vctt94 vctt94 force-pushed the functoinal-proposal-details branch from 0d921f2 to 1c35c99 Compare April 9, 2020 16:19
@alexlyp alexlyp merged commit c2d8557 into decred:master Apr 10, 2020
@vctt94 vctt94 deleted the functoinal-proposal-details branch April 16, 2020 15:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants