-
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
assets/components/Buttons.tsx
Outdated
} | ||
|
||
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
|
||
interface IPropsSubmit extends IPropsButtonBase { | ||
type: 'submit', | ||
onClick?(event: React.MouseEvent<HTMLButtonElement, MouseEvent>): void; |
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 would still make this mandatory, if we need to put there empty function in case this is not needed it's probably better than forgetting it when it's needed. same goes for reset button
import {IconButton, IPropsSize, IPropsVariant} from './IconButton'; | ||
|
||
interface IProps { | ||
testId?: 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.
I see this is data-test-id
on other components, would be good to make it consistent
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.
so change the name?
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.
yes
action={action} | ||
isVisited={action.visited && action.visited(this.props.user, this.props.item)} |
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.
why are we dropping this functionality?
NHUB-464
Checklist
lodash.get
with optional chaining for modified code segments