-
Notifications
You must be signed in to change notification settings - Fork 22
feat: add editor mode switch #404
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
Conversation
|
Preview is ready. |
| $buttonIconSize: 16px; | ||
| $buttonWidth: 76px; | ||
| $buttonHeight: 40px; | ||
| $zIndex: 110; |
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.
up to you, but if we use this variable one time, maybe we dont need this variable ?
| onViewModeChange, | ||
| className, | ||
| }: ControlPanelProps) => { | ||
| return ( |
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.
return jsx immediately
| if (isEditingMode) { | ||
| return { | ||
| content, | ||
| custom: addCustomDecorator( |
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.
maybe refactor like this:
{
....
const customProp = isEditingMode ? ... : rest.custom;
...
return {content, custom: customProp};
}
src/editor/hooks/usePrevious.ts
Outdated
| @@ -0,0 +1,11 @@ | |||
| import {useEffect, useRef} from 'react'; | |||
|
|
|||
| export default function usePrevious<T>(value: T) { | |||
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 we use this hook to save previous value, i think we need named this hook like usePreviousValue, because it's not obvious what the previous entity is
NikitaCG
left a comment
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.
see in comments
No description provided.