-
Notifications
You must be signed in to change notification settings - Fork 100
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
docs(many): function based examples are added to ToggleButton, Trucat… #1629
docs(many): function based examples are added to ToggleButton, Trucat… #1629
Conversation
|
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.
looks good, all problems are from the original examples but we should fix those regardless
|
||
- ```js | ||
const InverseExample = () => { | ||
const [lockedStatus, setLockedStatus] = useState('off') |
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.
the original example is kind of strange for this. lockedStatus
could be a boolean variable so this strange conversion wouldn't be needed
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.
agree
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 simplified the code with a boolean
<ToggleButton | ||
status={locked ? 'pressed' : 'unpressed'} | ||
color="primary-inverse" | ||
renderIcon={locked ? IconLockSolid : IconUnlockLine} | ||
screenReaderLabel={locked ? 'Unlock assignment' : 'Lock assignment'} | ||
renderTooltipContent={locked ? 'Unlock' : 'Lock'} | ||
onClick={this.handleLocked} | ||
onClick={handleLocked} | ||
mountNode={() => document.getElementById('inverseToggleContainer')} |
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.
this prop is also a bit strange. does it work without it?
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 works without it, removed
render(<InverseExample />) | ||
``` | ||
render(<InverseExample />) | ||
``` |
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.
if there was no problem with my suggestions could you please fix the original examples too?
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.
Done
- ```javascript | ||
class Example extends React.Component { | ||
state = { | ||
value: '2020-05-18T23:59:00' |
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.
this is a strange default value if the steps are 15 mins which makes is value basically invalid. could be better to remove or change it
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 remember that this use case was specifically requested (default value could be something that is not in the dropdown), so I'd leave it here. The explanation when this is used to set a deadline its default is 1 min before midnight, which the user should be able to change.
When we make a new TimeSelect
it should handle this better.
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 left this unchanged.
…eText and TimeSelect Closes: INSTUI-4153
8c2ca4b
to
1d3e78a
Compare
…eText and TimeSelect
Closes: INSTUI-4153