Skip to content

Commit

Permalink
fix: ui bug of modal
Browse files Browse the repository at this point in the history
  • Loading branch information
Jun99uu committed Oct 14, 2023
1 parent c9794da commit cab917a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 5 deletions.
9 changes: 8 additions & 1 deletion client/src/components/Modal/Confrim/index.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { ComponentProps } from 'react';
import { ModalButton, Message, ModalContent, Title } from '../common';
import { css } from '@emotion/react';

interface ModalProps extends ComponentProps<'button'> {
/**
Expand All @@ -17,9 +18,15 @@ const ConfirmModal = ({ title, message, ...props }: ModalProps) => {
<ModalContent>
<Title>{title}</Title>
<Message>{message}</Message>
<ModalButton {...props}>확인</ModalButton>
<ModalButton css={buttonStyle} {...props}>
확인
</ModalButton>
</ModalContent>
);
};

const buttonStyle = css`
width: 20rem;
`;

export default ConfirmModal;
11 changes: 9 additions & 2 deletions client/src/components/Modal/Decision/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ const DecisionModal = ({ title, message, onCancle, ...props }: ModalProps) => {
<Title>{title}</Title>
<Message>{message}</Message>
<ButtonsWrapper>
<ModalButton css={closeStyle} onClick={onCancle}>
<ModalButton css={[closeStyle, commonStyle]} onClick={onCancle}>
닫기
</ModalButton>
<ModalButton {...props}>확인</ModalButton>
<ModalButton css={commonStyle} {...props}>
확인
</ModalButton>
</ButtonsWrapper>
</ModalContent>
);
Expand All @@ -41,6 +43,11 @@ const ButtonsWrapper = styled.div`
${flex('row', 'center', 'center', 0.8)};
`;

const commonStyle = css`
flex: 1;
max-width: 20rem;
`;

const closeStyle = css`
background-color: ${COLORS.disabled};
color: white;
Expand Down
3 changes: 1 addition & 2 deletions client/src/components/Modal/common.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,8 @@ export const ModalButton = styled.button`
background-color: ${COLORS.primary};
color: ${COLORS.white};
border-radius: 50rem;
flex: 1;
height: 3.2rem;
max-width: 20rem;
${TYPO.text2.Md};
position: relative;
Expand Down

0 comments on commit cab917a

Please sign in to comment.