-
Notifications
You must be signed in to change notification settings - Fork 30
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
fix close dialog box editor notification #1228 #1249
fix close dialog box editor notification #1228 #1249
Conversation
|
@@ -21,7 +22,9 @@ const Alert: React.FC<React.PropsWithChildren<AlertProps>> = ({ | |||
<></> | |||
)} | |||
<Typography css={{ flex: 1 }}>{children}</Typography> | |||
<Icons.Close /> | |||
<button> | |||
<Icons.Close onClick={handleClose} /> |
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.
@helioLJ this is a great addition! thanks for adding handleClose prop.
can you please make the onClick on the button rather than the Icon
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.
Sure! I it will be more concise this way, ty
@@ -28,4 +28,10 @@ export const Container = styled.div<Styles>` | |||
`; | |||
}} | |||
} | |||
|
|||
> button { |
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.
it's recommended to write it this way: & > button {
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.
Ok
@@ -1,4 +1,5 @@ | |||
export interface AlertProps { | |||
signal?: 'notify' | 'success' | 'error'; | |||
handleClose?: () => void; |
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 type here is not so accurate handleClose?: (e?: React.MouseEvent<HTMLButtonElement, MouseEvent>) => void;
is more explicit
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.
Thanks for your feedback, Mohammed! I'll make these changes soon as possible
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.
…mponent improve-alert-component
State to check if editor
isClosedor not, by default it's
false`, since the dialog starts open.fragment
ifisClosed
it's true.EditorNotification
.closeEditor()
to theAlert
component.EditorNotification.js
handleClose
as a void function inAlertProps
file.index.ts
Icons.Close
in a button to select it inStyledAlert.ts
Alert.tsx
StyledAlert.ts