-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #201 from KKYHH/refactor/MainMobileUI
✨ feat: 메인 페이지 모바일 UI 구현 및 modal 추가
- Loading branch information
Showing
17 changed files
with
536 additions
and
418 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 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,210 +1,96 @@ | ||
import * as S from '@styles/Main/BottomSection.style'; | ||
import AnimateReward from './AnimateReward'; | ||
import styled from 'styled-components'; | ||
import subCharacter from '@icon/subCharacter.png'; | ||
import Swal from 'sweetalert2'; | ||
|
||
import { semantic } from '@styles/semantic'; | ||
import { useReward } from '@hooks/api/useReward'; | ||
import { Link } from 'react-router-dom'; | ||
import { MAIN_MESSAGES } from '@constants/message'; | ||
import { useModal } from '@state/modal/useModal'; | ||
import { MAIN_MESSAGES, MODAL } from '@constants/message'; | ||
import { ReactComponent as Avatar } from '@svg/avatarBg.svg'; | ||
import { ReactComponent as Arrow } from '@svg/chevron_right.svg'; | ||
import { ReactComponent as ArrowBlack } from '@svg/chevron_right_black.svg'; | ||
import { TYPO } from '@styles/typo'; | ||
|
||
const BottomSection = () => { | ||
const { reward } = useReward(); | ||
const { modal } = useModal(); | ||
|
||
const themeModal = () => { | ||
const setting = { | ||
title: MODAL.main.modal.preparation_notice, | ||
content: MODAL.main.modal.modal_notice('테마 상점은'), | ||
}; | ||
|
||
const button1 = { | ||
active: true, | ||
text: MODAL.main.modal.confirm_button, | ||
color: semantic.light.accent.solid.alternative, | ||
}; | ||
modal(setting, button1); | ||
}; | ||
|
||
const modal = () => { | ||
Swal.fire({ | ||
title: '테마 상점', | ||
text: '테마 상점 준비중이에요', | ||
imageUrl: subCharacter, | ||
imageWidth: 300, | ||
imageHeight: 300, | ||
imageAlt: 'Custom image', | ||
confirmButtonColor: '#28CA3B', | ||
confirmButtonText: '확인', | ||
}); | ||
const reviewModal = () => { | ||
const setting = { | ||
title: MODAL.main.modal.preparation_notice, | ||
content: MODAL.main.modal.modal_notice('한 달 일기 회고는'), | ||
}; | ||
|
||
const button1 = { | ||
active: true, | ||
text: MODAL.main.modal.confirm_button, | ||
color: semantic.light.accent.solid.alternative, | ||
}; | ||
modal(setting, button1); | ||
}; | ||
|
||
const handleClick = () => window.scrollTo(0, 0); | ||
return ( | ||
<> | ||
<Section> | ||
<Container> | ||
<Card> | ||
<CardText>{MAIN_MESSAGES.bottom_section.my_reward}</CardText> | ||
<CardSubText> | ||
<S.Section> | ||
<S.Container> | ||
<S.Card> | ||
<S.CardText>{MAIN_MESSAGES.bottom_section.my_reward}</S.CardText> | ||
<S.CardSubText> | ||
{MAIN_MESSAGES.bottom_section.reward_message} | ||
</CardSubText> | ||
<Divider></Divider> | ||
<Wrap> | ||
<RewardContainer> | ||
<Avatar></Avatar> | ||
<RewardPointBox> | ||
</S.CardSubText> | ||
<S.Divider /> | ||
<S.Wrap> | ||
<S.RewardContainer> | ||
<Avatar /> | ||
<S.RewardPointBox> | ||
<AnimateReward n={reward?.rewardPoint ?? 0} /> | ||
</RewardPointBox> | ||
</RewardContainer> | ||
<ThemeMarketBtn> | ||
<ThemeMarketText onClick={modal}> | ||
</S.RewardPointBox> | ||
</S.RewardContainer> | ||
<S.ThemeMarketBtn onClick={themeModal}> | ||
<S.ThemeMarketText> | ||
{MAIN_MESSAGES.bottom_section.theme_store} | ||
</ThemeMarketText> | ||
</S.ThemeMarketText> | ||
<Arrow | ||
width={18} | ||
height={18} | ||
fill={semantic.light.accent.solid.hero} | ||
></Arrow> | ||
</ThemeMarketBtn> | ||
</Wrap> | ||
</Card> | ||
<Card> | ||
<CardText> | ||
</S.ThemeMarketBtn> | ||
</S.Wrap> | ||
</S.Card> | ||
<S.Card> | ||
<S.CardText> | ||
{MAIN_MESSAGES.bottom_section.monthly_diary_review} | ||
</CardText> | ||
<CardSubText> | ||
</S.CardText> | ||
<S.CardSubText> | ||
{MAIN_MESSAGES.bottom_section.review_description} | ||
</CardSubText> | ||
<Divider></Divider> | ||
<RetrospectContainer> | ||
<RetrospectBtn> | ||
<Link to="/mypage" onClick={handleClick}> | ||
<RetrospectText> | ||
{MAIN_MESSAGES.bottom_section.go_to_review} | ||
</RetrospectText> | ||
</Link> | ||
</S.CardSubText> | ||
<S.Divider /> | ||
<S.RetrospectContainer> | ||
<S.RetrospectBtn onClick={reviewModal}> | ||
<S.RetrospectText> | ||
{MAIN_MESSAGES.bottom_section.go_to_review} | ||
</S.RetrospectText> | ||
<ArrowBlack></ArrowBlack> | ||
</RetrospectBtn> | ||
</RetrospectContainer> | ||
</Card> | ||
</Container> | ||
</Section> | ||
</S.RetrospectBtn> | ||
</S.RetrospectContainer> | ||
</S.Card> | ||
</S.Container> | ||
</S.Section> | ||
</> | ||
); | ||
}; | ||
|
||
export default BottomSection; | ||
|
||
const Section = styled.div` | ||
display: flex; | ||
padding: var(--gap-lg, 1.25rem) var(--gap-xl, 1.5rem); | ||
justify-content: center; | ||
align-items: center; | ||
gap: var(--gap-xl, 1.5rem); | ||
align-self: stretch; | ||
`; | ||
|
||
const Container = styled.div` | ||
display: flex; | ||
max-width: var(--vw-desktop-min, 60rem); | ||
justify-content: center; | ||
align-items: center; | ||
gap: var(--gap-xl, 1.5rem); | ||
flex: 1 0 0; | ||
`; | ||
|
||
const Card = styled.div` | ||
display: flex; | ||
padding: var(--gap-lg, 1.25rem); | ||
flex-direction: column; | ||
align-items: flex-start; | ||
gap: var(--gap-md, 1rem); | ||
flex: 1 0 0; | ||
border-radius: var(--radius-md, 1rem); | ||
border: var(--stroke-thin, 0.0625rem) solid | ||
${semantic.light.border.transparent.assistive}; | ||
background: ${semantic.light.bg.solid.normal}; | ||
box-shadow: 0rem 0rem 0.0625rem 0rem rgba(0, 0, 0, 0.04), | ||
0rem 0.125rem 0.25rem 0rem rgba(0, 0, 0, 0.08); | ||
`; | ||
|
||
const Divider = styled.div` | ||
width: 26.75rem; | ||
height: 0.0625rem; | ||
background: ${semantic.light.border.transparent.alternative}; | ||
`; | ||
|
||
const CardText = styled.p` | ||
align-self: stretch; | ||
color: ${semantic.light.object.transparent.neutral}; | ||
${TYPO.label3} | ||
`; | ||
|
||
const CardSubText = styled.p` | ||
align-self: stretch; | ||
color: ${semantic.light.object.transparent.neutral}; | ||
${TYPO.caption2} | ||
`; | ||
|
||
const Wrap = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: var(--gap-md, 1rem); | ||
align-self: stretch; | ||
`; | ||
|
||
const RewardContainer = styled.div` | ||
display: flex; | ||
align-items: center; | ||
gap: var(--gap-2xs, 0.5rem); | ||
flex: 1 0 0; | ||
`; | ||
|
||
const RewardPointBox = styled.div` | ||
flex: 1 0 0; | ||
color: ${semantic.light.accent.solid.normal}; | ||
`; | ||
|
||
const ThemeMarketBtn = styled.button` | ||
display: flex; | ||
padding: var(--gap-xs, 0.625rem) var(--gap-md, 1rem); | ||
justify-content: center; | ||
align-items: center; | ||
gap: var(--gap-2xs, 0.5rem); | ||
border-radius: var(--radius-xs, 0.5rem); | ||
border: var(--stroke-thin, 0.0625rem) solid | ||
${semantic.light.accent.solid.normal}; | ||
background: ${semantic.light.accent.transparent.normal}; | ||
cursor: pointer; | ||
`; | ||
|
||
const ThemeMarketText = styled.p` | ||
color: ${semantic.light.accent.solid.hero}; | ||
text-align: center; | ||
${TYPO.label2} | ||
`; | ||
|
||
const RetrospectContainer = styled.div` | ||
display: flex; | ||
justify-content: flex-end; | ||
align-items: center; | ||
align-self: stretch; | ||
`; | ||
|
||
const RetrospectBtn = styled.button` | ||
display: flex; | ||
padding: var(--gap-xs, 0.625rem) var(--gap-md, 1rem); | ||
justify-content: center; | ||
align-items: center; | ||
gap: var(--gap-2xs, 0.5rem); | ||
border-radius: var(--radius-xs, 0.5rem); | ||
`; | ||
|
||
const RetrospectText = styled.p` | ||
text-align: center; | ||
${TYPO.label2} | ||
`; |
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.