mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-02-13 21:05:19 +00:00
feat: modify Modal component style
This commit is contained in:
@@ -91,8 +91,6 @@ export const ContactModal = ({
|
|||||||
<span>Alpha</span>
|
<span>Alpha</span>
|
||||||
</StyledModalHeaderLeft>
|
</StyledModalHeaderLeft>
|
||||||
<ModalCloseButton
|
<ModalCloseButton
|
||||||
top={6}
|
|
||||||
right={6}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -29,8 +29,6 @@ export const DeleteModal = ({
|
|||||||
<ModalWrapper width={620} height={334}>
|
<ModalWrapper width={620} height={334}>
|
||||||
<Header>
|
<Header>
|
||||||
<ModalCloseButton
|
<ModalCloseButton
|
||||||
top={6}
|
|
||||||
right={6}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -14,8 +14,6 @@ export const LoginModal = ({ open, onClose }: LoginModalProps) => {
|
|||||||
<ModalWrapper width={560} height={292}>
|
<ModalWrapper width={560} height={292}>
|
||||||
<Header>
|
<Header>
|
||||||
<ModalCloseButton
|
<ModalCloseButton
|
||||||
top={6}
|
|
||||||
right={6}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -15,8 +15,6 @@ export const LogoutModal = ({ open, onClose }: LoginModalProps) => {
|
|||||||
<ModalWrapper width={560} height={292}>
|
<ModalWrapper width={560} height={292}>
|
||||||
<Header>
|
<Header>
|
||||||
<ModalCloseButton
|
<ModalCloseButton
|
||||||
top={6}
|
|
||||||
right={6}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClose(true);
|
onClose(true);
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -76,8 +76,6 @@ export const InviteMemberModal = ({
|
|||||||
<ModalWrapper width={460} height={236}>
|
<ModalWrapper width={460} height={236}>
|
||||||
<Header>
|
<Header>
|
||||||
<ModalCloseButton
|
<ModalCloseButton
|
||||||
top={6}
|
|
||||||
right={6}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
onClose();
|
onClose();
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import { styled } from '@/styles';
|
|||||||
export type ModalCloseButtonProps = {
|
export type ModalCloseButtonProps = {
|
||||||
top?: number;
|
top?: number;
|
||||||
right?: number;
|
right?: number;
|
||||||
|
absolute?: boolean;
|
||||||
} & Omit<IconButtonProps, 'children'> &
|
} & Omit<IconButtonProps, 'children'> &
|
||||||
HTMLAttributes<HTMLButtonElement>;
|
HTMLAttributes<HTMLButtonElement>;
|
||||||
|
|
||||||
@@ -13,16 +14,23 @@ const StyledIconButton = styled(IconButton)<
|
|||||||
>(({ top, right }) => {
|
>(({ top, right }) => {
|
||||||
return {
|
return {
|
||||||
position: 'absolute',
|
position: 'absolute',
|
||||||
top: top ?? 6,
|
top: top ?? 24,
|
||||||
right: right ?? 6,
|
right: right ?? 40,
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
export const ModalCloseButton = ({ ...props }: ModalCloseButtonProps) => {
|
export const ModalCloseButton = ({
|
||||||
return (
|
absolute = true,
|
||||||
|
...props
|
||||||
|
}: ModalCloseButtonProps) => {
|
||||||
|
return absolute ? (
|
||||||
<StyledIconButton {...props}>
|
<StyledIconButton {...props}>
|
||||||
<CloseIcon />
|
<CloseIcon />
|
||||||
</StyledIconButton>
|
</StyledIconButton>
|
||||||
|
) : (
|
||||||
|
<IconButton>
|
||||||
|
<CloseIcon />
|
||||||
|
</IconButton>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ export const ModalWrapper = styled.div<{
|
|||||||
height,
|
height,
|
||||||
minHeight,
|
minHeight,
|
||||||
backgroundColor: theme.colors.popoverBackground,
|
backgroundColor: theme.colors.popoverBackground,
|
||||||
borderRadius: '12px',
|
borderRadius: '24px',
|
||||||
position: 'relative',
|
position: 'relative',
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user