Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Design] #45 마이페이지 알림 설정 페이지 #76

Merged
merged 7 commits into from
Nov 24, 2024
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ const MobileWrapper = styled.div`
background-color: ${({ theme }) => theme.colors.brand.lighten_3}; /* 배경색 (GC_4) */
min-width: 340px;
max-width: 430px;
/* width: 375px; */
min-height: calc(var(--vh, 1vh) * 100);
kimjuyoung78 marked this conversation as resolved.
Show resolved Hide resolved
margin: auto;
position: relative;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/ActionButton.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const ACTION_BUTTON_STYLES: Record<Exclude<ActionButtonProps['$type'], undefined
},
semiRoundedRect: {
padding: '16.5px 24px',
borderRadius: '20px',
borderRadius: '12px',
fontSize: '_15',
},
capsule: {
Expand Down
39 changes: 39 additions & 0 deletions src/pages/MyPage/SettingModal/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import * as S from './styles'
import { PrevButton } from '~components/Button/PrevButton/styles'
import { Typo17 } from '~components/Typo'
import ToggleArea from '~components/ToggleArea'
import ToggleBox from '~components/ToggleBox'
type SettingModalProps = {
isOpen: boolean
onClose: () => void
}

export default function SettingsModal({ isOpen, onClose }: SettingModalProps) {
kimjuyoung78 marked this conversation as resolved.
Show resolved Hide resolved
if (!isOpen) return null

return (
<S.SettingModalContainer>
<S.Header>
<S.BackButton onClick={onClose}>
<PrevButton size={28} />
</S.BackButton>
<S.TitleWrap>
<Typo17 weight='700'>설정</Typo17>
</S.TitleWrap>
</S.Header>

<S.Content>
<S.AllButtonWrapper>
<ToggleBox type='lg' setting='allNotifications' />
</S.AllButtonWrapper>
<ToggleArea />
</S.Content>

<S.QuitButtonArea>
<S.CustomQuiteButton $type='semiRoundedRect' $bgColor='gc_4' $fontWeight='700'>
kimjuyoung78 marked this conversation as resolved.
Show resolved Hide resolved
탈퇴하기
</S.CustomQuiteButton>
</S.QuitButtonArea>
</S.SettingModalContainer>
)
}
67 changes: 67 additions & 0 deletions src/pages/MyPage/SettingModal/styles.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { styled } from 'styled-components'
import { ActionButton } from '~components/Button/ActionButton'

//헤더
export const SettingModalContainer = styled.div`
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: ${({ theme }) => theme.colors.brand.lighten_3};
z-index: 1000;
display: flex;
flex-direction: column;
`

export const Header = styled.div`
height: 56px;
padding: 0 20px;
display: flex;
align-items: center;
position: relative;
background-color: white;
kimjuyoung78 marked this conversation as resolved.
Show resolved Hide resolved
`

export const BackButton = styled.button`
position: absolute;
left: -3px;
background: none;
border: none;
margin-top: -55px;
cursor: pointer;
display: flex;
align-items: center;
`

export const TitleWrap = styled.h1`
width: 100%;
text-align: center;
margin: 0;
`
//토글 영역
export const AllButtonWrapper = styled.div`
padding-bottom: 16px;
`
export const ToggleArea = styled.div`
display: flex;
flex-direction: column;
gap: 16px;
width: 100%;
`
export const Content = styled.div`
flex: 1;
padding: 20px;

overflow-y: auto;
`
//탈퇴하기 버튼
export const CustomQuiteButton = styled(ActionButton)`
font-size: ${({ theme }) => theme.typography._17};
color: ${({ theme }) => theme.colors.grayscale.font_1};
background-color: ${({ theme }) => theme.colors.brand.lighten_2};
`
export const QuitButtonArea = styled.div`
width: 100%;
padding: 20px;
`
15 changes: 14 additions & 1 deletion src/pages/MyPage/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
import { useState } from 'react'
import * as S from './styles'
import { Helmet } from 'react-helmet-async'
import { IoSettingsOutline } from 'react-icons/io5'
import ProfileImage from 'assets/masterprofile.svg'
import { Typo13, Typo15, Typo24 } from '~components/Typo'
import ToggleBox from '~components/ToggleBox'
import { useTheme } from 'styled-components'
import SettingsModal from '~pages/MyPage/SettingModal'

export default function MyPage() {
const theme = useTheme()
const [isSettingsOpen, setIsSettinsOpen] = useState(false)

const handleSettingsClik = () => {
kimjuyoung78 marked this conversation as resolved.
Show resolved Hide resolved
setIsSettinsOpen(true)
}

const handleCloseSteeings = () => {
kimjuyoung78 marked this conversation as resolved.
Show resolved Hide resolved
setIsSettinsOpen(false)
}

return (
<S.MyPage>
<Helmet>
Expand All @@ -16,7 +28,7 @@ export default function MyPage() {
</Helmet>
<S.HeaderContainer>
마이페이지
<S.SettingIcon>
<S.SettingIcon onClick={handleSettingsClik}>
<IoSettingsOutline cursor='pointer' size={28} />
</S.SettingIcon>
</S.HeaderContainer>
Expand Down Expand Up @@ -65,6 +77,7 @@ export default function MyPage() {
</S.CustomActionButton>
</S.ButtonArea>
</S.MainContainer>
<SettingsModal isOpen={isSettingsOpen} onClose={handleCloseSteeings} />
</S.MyPage>
)
}
Loading