Skip to content
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

Merged
merged 3 commits into from
Sep 17, 2019

Conversation

goeson00
Copy link
Collaborator

No description provided.

Copy link
Contributor

@szymon-owczarzak szymon-owczarzak left a 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')}
Copy link
Collaborator

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:

  1. () => handleChange('switchInterval')
  2. handleChange.bind(this, 'switchInterval')

Copy link
Collaborator Author

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) => {
Copy link
Collaborator

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

Copy link
Collaborator Author

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 };
Copy link
Collaborator

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed

@szymon-owczarzak szymon-owczarzak merged commit 6558432 into master Sep 17, 2019
Cich0sza pushed a commit that referenced this pull request Sep 23, 2019
…ting

Add advanced board switcher functionality
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants