-
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
Button component #711
base: develop
Are you sure you want to change the base?
Button component #711
Conversation
* add navigation * changes after review * fix lint * chages after review
hi @dzonidoo can you update the PR so we can merge it? |
* add navigation * changes after review * fix lint * chages after review
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.
would rename this so it matches the component name like all the other files
export type IPropsSize = 'small' | 'medium' | 'large'; | ||
|
||
export interface IPropsButtonBase { | ||
value: string; |
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.
imo would be better to work with children so it's more like regular button, or call this label because there is no value
really like on an input
} | ||
|
||
interface IPropsReset extends IPropsButtonBase { | ||
type?: 'reset', |
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.
I guess here the type must be reset
so should be probably just type: 'reset'
,
I'm also wondering if we have a usecase where we wouldn't use it with onClick
, might be better to make it mandatory if not to get this checked.
same applies to submit
import PropTypes from 'prop-types'; | ||
import {gettext} from 'utils'; | ||
|
||
function CloseModalButton({onClick}: any) { |
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.
I wonder what's the usecase for having this one and CloseButton
which seems to handle modals as well
NHUB-464
Checklist
lodash.get
with optional chaining for modified code segments