-
Notifications
You must be signed in to change notification settings - Fork 15
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
Allow additional classes to be specified on the clean up button #1737
Changes from all commits
5d74004
0cdbb13
a3bd998
b982d0d
609473f
826021d
e5ff559
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,22 @@ | ||
import React from 'react'; | ||
|
||
import { EOS_CLEANING_SERVICES } from 'eos-icons-react'; | ||
import classNames from 'classnames'; | ||
|
||
import Button from '@components/Button'; | ||
import Spinner from '@components/Spinner'; | ||
|
||
function CleanUpButton({ cleaning, onClick }) { | ||
function CleanUpButton({ className, size = 'small', cleaning, onClick }) { | ||
const buttonClasses = classNames( | ||
'inline-block mx-0.5 border-green-500 border w-fit', | ||
className | ||
); | ||
|
||
return ( | ||
<Button | ||
type="primary-white" | ||
className="inline-block mx-0.5 border-green-500 border w-fit" | ||
size="small" | ||
className={buttonClasses} | ||
size={size} | ||
disabled={cleaning} | ||
onClick={() => onClick()} | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Just a comment, when we have this "dummy" components, without any particular logic on the event handlers, for example take a modal which has on the In that button we have a direct onclick handler, without any logic and it's a common pratice, but totally optional, to pass directly the handler, like This is completely optional in that case, there are different opinions about that, for sure it's true in pure design systems component, take bootstrap for example, you want to give the callee the direct facade to the html event. If you want change it, otherwise leave as is and we could have this comment as a future discussion. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Actually, now that I read this, I'm wondering how it works (JS mysteries to me XD).
so it is kind of done twice. |
||
> | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -13,6 +13,22 @@ export default { | |
}, | ||
}, | ||
onClick: { action: 'Click button' }, | ||
className: { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Add |
||
control: 'text', | ||
description: 'CSS classes', | ||
table: { | ||
type: { summary: 'string' }, | ||
}, | ||
}, | ||
size: { | ||
control: { type: 'radio' }, | ||
options: ['small', 'fit'], | ||
description: 'Button size', | ||
table: { | ||
type: { summary: 'string' }, | ||
defaultValue: { summary: 'small' }, | ||
}, | ||
}, | ||
}, | ||
}; | ||
|
||
|
@@ -26,3 +42,11 @@ export const Cleaning = { | |
cleaning: true, | ||
}, | ||
}; | ||
|
||
export const NoOutline = { | ||
args: { | ||
...Default.args, | ||
className: 'border-none shadow-none', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could we put |
||
size: 'fit', | ||
}, | ||
}; |
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 could even add a story for this