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

Button: add classname as props #146

Closed
wants to merge 1 commit into from
Closed

Button: add classname as props #146

wants to merge 1 commit into from

Conversation

Thykof
Copy link
Contributor

@Thykof Thykof commented May 31, 2023

this would allow me to do:

<Button className="w-full" variant="secondary" preIcon={<FiPlus />}>
  {Intl.t('account.add')}
</Button>

because w-full as been removed from the Button component, I need to add it in some places.

const buttonClass = variant ? secondaryClass : primaryClass;
let className = variant ? secondaryClass : primaryClass;

if (props.className) className = className + ' ' + props.className;
Copy link
Contributor

Choose a reason for hiding this comment

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

Humm, not sure about that! This is tricky because we don't know in the API signature what className we are overriding. 🤔

There's many others className in the component implementation.

@Thykof Thykof marked this pull request as draft May 31, 2023 14:35
@Thykof
Copy link
Contributor Author

Thykof commented May 31, 2023

we do this #147 instead

@Thykof Thykof closed this May 31, 2023
@Thykof Thykof deleted the button-add-classname branch May 31, 2023 15:17
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