-
Notifications
You must be signed in to change notification settings - Fork 10
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
feat: added snow #71
feat: added snow #71
Conversation
startSnowflakes(); | ||
}); | ||
|
||
const getCanvasElementById = (id: string): HTMLCanvasElement => { |
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.
useCallback hook for function creation
return canvas; | ||
}; | ||
|
||
const getCanvasRenderingContext2D = (canvas: HTMLCanvasElement): CanvasRenderingContext2D => { |
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.
useCallback hook for function creation
return context; | ||
}; | ||
|
||
function startSnowflakes() { |
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.
useCallback hook for function creation
const requestId = React.useRef(0); | ||
|
||
useEffect(() => { | ||
startSnowflakes(); |
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.
you can create useSnowflakes hook and incapsulate all logic inside
|
||
const MAIN_YELLOW = '#F2E14C'; | ||
|
||
const useStyles = makeStyles({ |
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 create useStyles variable outside component, otherwise this variable will be create on each component Render
|
||
return ( | ||
<> | ||
<div className='snow-switcher'> |
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 use styles that you created by makeStyles, the same for all className
@@ -0,0 +1,18 @@ | |||
#snow { |
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 relocate styles to makeStyles function
@@ -0,0 +1,31 @@ | |||
@media screen and (min-width: 960px) { |
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.
you can add media by css-in-js, please relocate it inside makeStyles function,
if you need an example, you can find code with 'theme.breakpoints.'
No description provided.