-
Notifications
You must be signed in to change notification settings - Fork 9
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
Add advanced board switcher functionality #45
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.
Please make this change compatible witch previous configs.
@@ -51,6 +52,19 @@ const BoardForm = ({ renderActions, ...initialFormValues }) => { | |||
label="Auto switch" | |||
/> | |||
</FormControl> | |||
{autoSwitch && | |||
<TextField | |||
onChange={handleChange('switchInterval')} |
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 invoking handleChange
on initial render is not intentional, you can use two different ways of binding parameter:
() => handleChange('switchInterval')
handleChange.bind(this, 'switchInterval')
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.
Bind is definitely slower than arrow, but it is intentional, check the implementation of handler and you will notice a function returning a function.
@@ -0,0 +1,15 @@ | |||
export const formatTime = (timeInSec) => { |
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.
Parenthesis are not necessary here, but it is convention. Decided style can be included in prettier config in the future
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.
Fixed.
[isPlaying, timeElapsed, switchInterval, switchBoard] | ||
); | ||
|
||
return { handleBoardsSwitch, handlePlayToggle, timeElapsed, switchInterval, isPlaying, prevBoardTitle, nextBoardTitle }; |
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.
Personally I would put here each prop in separate line, but it's also convention and configurable by prettier
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.
fixed
…ting Add advanced board switcher functionality
No description provided.