-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Refactor/#293: 모달 합성 컴포넌트 적용 && 지도 페이지 의존성 주입 Context API 적용
- Loading branch information
Showing
35 changed files
with
619 additions
and
618 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,5 @@ | ||
import { modals } from '@hooks/useModals'; | ||
|
||
export type Modals = | ||
| Array<{ | ||
Component: (typeof modals)[keyof typeof modals]; | ||
props: object; | ||
Component: React.ReactElement<{ chidren: React.ReactNode }>; | ||
}> | ||
| []; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { css } from '@emotion/react'; | ||
import useModals from '@hooks/useModals'; | ||
import { THEME } from '@styles/ThemeProvider/theme'; | ||
import { IconKind } from '@type/styles/icon'; | ||
import React from 'react'; | ||
|
||
import Button from '../Button'; | ||
import Icon from '../Icon'; | ||
|
||
interface ModalButtonProps { | ||
text: string; | ||
iconKind?: IconKind & 'plus'; | ||
onClick?: () => void; | ||
} | ||
|
||
const ModalButton = ({ text, iconKind, onClick }: ModalButtonProps) => { | ||
const { closeModal } = useModals(); | ||
|
||
const onButtonClick = () => { | ||
closeModal(); | ||
onClick && onClick(); | ||
}; | ||
|
||
return ( | ||
<Button | ||
onClick={onButtonClick} | ||
css={css` | ||
font-size: 0.8rem; | ||
`} | ||
> | ||
{iconKind && <Icon kind={iconKind} color={THEME.TEXT.WHITE} />} | ||
{text} | ||
</Button> | ||
); | ||
}; | ||
|
||
export default ModalButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import styled from '@emotion/styled'; | ||
import { THEME } from '@styles/ThemeProvider/theme'; | ||
import React from 'react'; | ||
|
||
interface ModalTitleProps { | ||
title: string; | ||
} | ||
|
||
const ModalTitle = ({ title }: ModalTitleProps) => { | ||
return <Title>{title}</Title>; | ||
}; | ||
|
||
export default ModalTitle; | ||
|
||
const Title = styled.span` | ||
padding: 20px 0 20px 0; | ||
text-align: center; | ||
line-height: 1.3; | ||
font-weight: bold; | ||
white-space: pre-line; | ||
color: ${THEME.TEXT.GRAY}; | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.