Skip to content

Commit

Permalink
refactor: 사용하지 않는 파일 제거 + 반응형 디자인
Browse files Browse the repository at this point in the history
- 모달 버튼의 폰트 크기 수정
  • Loading branch information
wukdddang committed Nov 10, 2023
1 parent 1032f26 commit 5ef3b9a
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 27 deletions.
Empty file.
70 changes: 43 additions & 27 deletions src/components/common/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,14 +66,14 @@ const Modal = () => {
return (
<AnimatePresence>
{modalState ? (
<StyleModalWrapper
<StyledModalWrapper
variants={wrapperVariants}
initial={'hidden'}
animate={'visible'}
exit={'exit'}
onClick={handleCloseModal}
>
<StyleModal
<StyledModal
variants={modalVariants}
initial={'hidden'}
animate={'visible'}
Expand All @@ -82,24 +82,24 @@ const Modal = () => {
onClick={handleModalClick}
>
{type == 'confirm' ? (
<StyleIcon src={ExclamationIcon} />
<StyledIcon src={ExclamationIcon} />
) : (
<StyleIcon src={WarningIcon} />
<StyledIcon src={WarningIcon} />
)}

<StyleMainText
<StyledMainText
font={'Body_20'}
fontWeight={900}
letterSpacing={-2}
subTrue={subText == undefined ? false : true}
>
{mainText}
</StyleMainText>
<StyleSubText font={'Body_12'} fontWeight={900} letterSpacing={-1} type={type}>
</StyledMainText>
<StyledSubText font={'Body_12'} fontWeight={900} letterSpacing={-1} type={type}>
{subText}
</StyleSubText>
</StyledSubText>
{type === 'confirm' ? (
<StyleButtonWrapper>
<StyledButtonWrapper>
<NormalButton
normalButtonType={'modal-accept'}
style={{ margin: 10 }}
Expand All @@ -114,75 +114,91 @@ const Modal = () => {
>
{'취소'}
</NormalButton>
</StyleButtonWrapper>
</StyledButtonWrapper>
) : (
<StyleButtonWrapper>
<NormalButton
<StyledButtonWrapper>
<StyledWarningAcceptButton
normalButtonType={'warning-accept'}
style={{ margin: 10 }}
onClick={OkAndClose}
>
{acceptText ? acceptText : '예, 나가겠습니다.'}
</NormalButton>
<NormalButton
</StyledWarningAcceptButton>
<StyledWarningAcceptButton
normalButtonType={'warning-deny'}
style={{ margin: 10 }}
onClick={handleCloseModal}
>
{cancelText ? cancelText : '아니오, 돌아가겠습니다.'}
</NormalButton>
</StyleButtonWrapper>
</StyledWarningAcceptButton>
</StyledButtonWrapper>
)}
</StyleModal>
</StyleModalWrapper>
</StyledModal>
</StyledModalWrapper>
) : (
''
)}
</AnimatePresence>
)
}

const StyleModalWrapper = styled(motion.div)`
const StyledModalWrapper = styled(motion.div)`
z-index: 999;
display: flex;
position: absolute;
justify-content: center;
align-items: center;
width: 414px;
max-width: 414px;
background-color: rgba(0, 0, 0, 0.4);
border-radius: 10px;
top: 0;
left: 0;
right: 0;
bottom: 0;
`
const StyleModal = styled(motion.div)<{ type: string }>`
width: 344px;
const StyledModal = styled(motion.div)<{ type: string }>`
max-width: 344px;
height: ${({ type }) => (type == 'warn' ? '195.6px' : '246px')};
z-index: 1;
position: absolute;
background-color: white;
border-radius: 10px;
box-shadow: 3px 3px 3px ${palette.GRAY400};
text-align: center;
@media (max-width: 280px) {
max-width: 260px;
}
`

const StyleButtonWrapper = styled.span`
const StyledIcon = styled.img`
margin: 22px;
`

const StyledButtonWrapper = styled.span`
justify-content: center;
margin: 10px;
display: flex;
`
const StyleMainText = styled(Text)<{ subTrue: boolean }>`
const StyledMainText = styled(Text)<{ subTrue: boolean }>`
color: ${palette.BLACK};
text-align: center;
margin-top: ${({ subTrue }) => (subTrue ? '' : '10px')};
margin-bottom: ${({ subTrue }) => (subTrue ? '20px' : '30px')};
`
const StyleSubText = styled(Text)<{ type: string }>`
const StyledSubText = styled(Text)<{ type: string }>`
color: ${palette.GRAY500};
text-align: center;
@media (max-width: 280px) {
font-size: 10.5px;
}
`
const StyleIcon = styled.img`
margin: 22px;

const StyledWarningAcceptButton = styled(NormalButton)`
@media (max-width: 280px) {
font-size: 10px;
}
`

export default Modal

0 comments on commit 5ef3b9a

Please sign in to comment.