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

Fix the prop types #1059

Merged
merged 11 commits into from Sep 17, 2019
Merged

Fix the prop types #1059

merged 11 commits into from Sep 17, 2019

Conversation

bpierre
Copy link
Contributor

@bpierre bpierre commented Sep 12, 2019

Builds on #1058

  • Templates kit
  • Components
  • Onboarding

- Remove longDesc and caseStudyUrl template entries (until we need
them).
- Move and rename the screen components into screens/.
- Add a prop type for screen-specific props.
- Unify the way screen components accept screen-specific props.
- Rename PrevNextFooter => Navigation.
@bpierre bpierre marked this pull request as ready for review September 12, 2019 18:39
@vercel vercel bot temporarily deployed to staging September 12, 2019 18:45 Inactive
Also renamed userGuide to userGuideUrl in the template format.
@vercel vercel bot temporarily deployed to staging September 13, 2019 09:59 Inactive
@bpierre
Copy link
Contributor Author

bpierre commented Sep 13, 2019

@sohkai @AquiGorka PR ready! 🚦

Copy link
Contributor

@AquiGorka AquiGorka left a comment

Choose a reason for hiding this comment

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

👌 👌

@vercel vercel bot temporarily deployed to staging September 17, 2019 18:58 Inactive
@vercel vercel bot temporarily deployed to staging September 17, 2019 19:01 Inactive
@vercel vercel bot temporarily deployed to staging September 17, 2019 19:23 Inactive
@vercel vercel bot temporarily deployed to staging September 17, 2019 19:27 Inactive
@bpierre bpierre merged commit 32e47b9 into master Sep 17, 2019
@delete-merged-branch delete-merged-branch bot deleted the fix-prop-types branch September 17, 2019 19:28
@@ -167,6 +168,12 @@ function Tokens({
}
}, [])

// Focus the token fields as they are added afterwards
Copy link
Contributor

Choose a reason for hiding this comment

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

Was this intended to be commented out?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

No that should be removed!

screenSubtitle = 'Have one last look at your settings below',
screenTitle = 'Review information',
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove these defaults, since they're supplied by the default props now

screenTitle = 'Claim a name',
},
screenProps: { back, data, next, screenIndex, screens },
screenTitle = 'Claim a name',
Copy link
Contributor

@sohkai sohkai Oct 9, 2019

Choose a reason for hiding this comment

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

Same as ReviewScreen, I think we can remove the defaults for dataKey and screenTitle :)

screenIndex: PropTypes.number.isRequired,

/*
* No tuples in prop-types… if it existed, screens would look like this:
Copy link
Contributor

Choose a reason for hiding this comment

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

We could technically define our own validation for a tuple

@@ -0,0 +1,23 @@
import PropTypes from 'prop-types'

export const ScreenPropsType = PropTypes.shape({
Copy link
Contributor

Choose a reason for hiding this comment

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

In prop-types we've used the Type suffix only, rather than PropsType. What do you think about changing this to just ScreenType?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It’s the Type suffix added to screenProps. I know it’s confusing 😆

@@ -140,4 +140,8 @@ function CreateSubtitle({ error }) {
return 'Start your organization with Aragon'
}

CreateSubtitle.propTypes = {
error: PropTypes.array.isRequired,
Copy link
Contributor

Choose a reason for hiding this comment

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

Looking back at this, we should probably use an object with named fields 😄

@@ -51,10 +56,10 @@ function Configure({
overflow: hidden;
`}
>
{mode === 'select' && (
{mode === CONFIGURE_MODE_SELECT && (
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm starting to think, maybe we should take the template selection part out of configure?

It'd probably simplify a lot of the props we pass around if we split these two (selecting template vs. configuring selected), and I don't think we have any transitions that depend on these two being together.

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.

None yet

3 participants