fix: style issue on mac

This commit is contained in:
GyDi 2022-06-15 02:41:37 +08:00
parent 55b7af2623
commit ba16ec02e5
No known key found for this signature in database
GPG Key ID: 58B15242BA8277A6

View File

@ -26,12 +26,13 @@ const NoticeInner = (props: InnerProps) => {
type === "info" ? (
message
) : (
<Box sx={{ display: "flex", alignItems: "center" }}>
<Box sx={{ width: 328, display: "flex", alignItems: "center" }}>
{type === "error" && <ErrorRounded color="error" />}
{type === "success" && <CheckCircleRounded color="success" />}
<Typography
sx={{ ml: 1, wordWrap: "break-word", wordBreak: "break-all" }}
component="span"
sx={{ ml: 1, wordWrap: "break-word", width: "calc(100% - 35px)" }}
>
{message}
</Typography>
@ -79,7 +80,7 @@ const Notice: NoticeInstance = (props) => {
const onUnmount = () => {
const result = ReactDOM.unmountComponentAtNode(container);
if (result && parent) setTimeout(() => parent.removeChild(container), 300);
if (result && parent) setTimeout(() => parent.removeChild(container), 500);
};
ReactDOM.render(<NoticeInner {...props} onClose={onUnmount} />, container);