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

Info modes #431

Merged
merged 6 commits into from Aug 1, 2019

Conversation

@bpierre
Copy link
Member

commented Aug 1, 2019

Info can now take a mode prop, with one of the following: info (default), warning, error.

Note: I went for a prop rather than separated Warning + Error components because Error is already used by JavaScript.

bpierre added some commits Aug 1, 2019

@bpierre bpierre requested a review from AquiGorka Aug 1, 2019

@AquiGorka
Copy link
Member

left a comment

:all-fiesta-emoji: My only question is about warn instead of warning, let me know your thoughts.

@bpierre bpierre merged commit 03ffabd into newstyle Aug 1, 2019

3 of 5 checks passed

continuous-integration/travis-ci/pr The Travis CI build could not complete due to an error
Details
continuous-integration/travis-ci/push The Travis CI build could not complete due to an error
Details
License Compliance All checks passed.
Details
WIP Ready for review
Details
license/cla Contributor License Agreement is signed.
Details

@delete-merged-branch delete-merged-branch bot deleted the newstyle-info-variants branch Aug 1, 2019

@sohkai
Copy link
Member

left a comment

🙌


export default Info
export { Info }

This comment has been minimized.

Copy link
@sohkai

sohkai Aug 1, 2019

Member

I may have missed the memo, but are we preferring non-default exports now?

This comment has been minimized.

Copy link
@bpierre

bpierre Aug 1, 2019

Author Member

Not a strict decision, I’ve just been experimenting with it recently.

Some advantages I found:

  • Not having to transform default imports into named imports.
  • We can export everything at once (instead of using two exports).
  • To avoid the mixed import syntax: import A, { useB } from './A'
  • Works great with files mixing components and hooks.

@sohkai @AquiGorka What do you think?

This comment has been minimized.

Copy link
@sohkai

sohkai Aug 1, 2019

Member

To avoid the mixed import syntax: import A, { useB } from './A'

I actually prefer this, as it tells me what the priority is. The default export is the "main" use, and anything else I consider utilities that are optional.

But since most users of aragonUI will be importing what they need through @aragon/ui directly through named exports, this is an internal thing and in that sense no external users should be impacted by this decision.

This comment has been minimized.

Copy link
@bpierre

bpierre Aug 1, 2019

Author Member

The default export is the "main" use, and anything else I consider utilities that are optional.

Yeah, ok let’s move back to have a main + named, at least for component modules, I don’t really have a strong opinion on this.

But since most users of aragonUI will be importing what they need through @aragon/ui directly through named exports, this is an internal thing and in that sense no external users should be impacted by this decision.

Yes exactly, that’s why I was freely trying this style to see how it feels.

This comment has been minimized.

Copy link
@AquiGorka

AquiGorka Aug 2, 2019

Member

I don't have a strong opinion here, the benefits Pierre outlined work for me and this is an internal thing so 👍

Info.Permissions = Permissions
// Backward compatibility
Info.Action = Info
Info.Permissions = Info

This comment has been minimized.

Copy link
@sohkai

sohkai Aug 1, 2019

Member

From what I can tell in the designs, I think Info.Permissions is also the warning mode.

This comment has been minimized.

Copy link
@bpierre

bpierre Aug 1, 2019

Author Member

Oh yes!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.