Skip to content

Commit

Permalink
feat: add introduce at mainPage
Browse files Browse the repository at this point in the history
  • Loading branch information
kcwww committed Dec 12, 2023
1 parent aded825 commit e3d2e37
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
8 changes: 6 additions & 2 deletions front/src/pages/Main/MainButtonBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import MenuModal from './MenuModal';
import ListMsgs from './ListMsgs';
import LockModal from './LockModal';
import { SnowBallContext } from '@pages/Visit/SnowBallProvider';

import Introduce from '@pages/Intro/Introduce';
interface MainButtonBoxProps {
leftArrow: React.RefObject<HTMLImageElement>;
rightArrow: React.RefObject<HTMLImageElement>;
Expand Down Expand Up @@ -157,6 +157,9 @@ const MainButtonBox = (props: MainButtonBoxProps) => {
}
};

const [setIntro, setShowIntro] = useState(false);


const privateClick = () => {
setIsModalOpened(true);
document.getElementById('lock')!.style.animation = 'fadeOut 1s forwards';
Expand Down Expand Up @@ -209,7 +212,8 @@ const MainButtonBox = (props: MainButtonBoxProps) => {
/>
)}

{menuModal ? <MenuModal set={setMenuModal} list={setList} /> : null}
{menuModal ? <MenuModal intro={[setIntro, setShowIntro]} set={setMenuModal} list={setList} /> : null}
{setIntro ? <><Introduce view={[setIntro, setShowIntro]}/></> : null }

<StyledScreen
ref={screenRef}
Expand Down
14 changes: 14 additions & 0 deletions front/src/pages/Main/MenuModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ import styled from 'styled-components';
import { useLogout } from '@hooks';
import { SnowBallContext } from '@pages/Visit/SnowBallProvider';


interface ModalProps {
set: React.Dispatch<React.SetStateAction<boolean>>;
list: React.Dispatch<React.SetStateAction<boolean>>;
intro: [boolean, React.Dispatch<React.SetStateAction<boolean>>];
}

const StyledModal = styled.div`
Expand Down Expand Up @@ -75,12 +77,20 @@ const MenuModal = (props: ModalProps) => {
navigate('/make/snowball');
};

const showIntro = () => {
props.set(false);
props.intro[1](true);
};


return (
<>
{toast ? (
<ToastMsg>์Šค๋…ธ์šฐ๋ณผ์€ ์ตœ๋Œ€ 5๊ฐœ๊นŒ์ง€ ๋งŒ๋“ค ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.</ToastMsg>
) : null}



<StyledModal>
<StyledUser>{userData.nickname}๋‹˜</StyledUser>
<hr />
Expand All @@ -98,6 +108,10 @@ const MenuModal = (props: ModalProps) => {
์ƒˆ๋กœ์šด ์Šค๋…ธ์šฐ๋ณผ ๋งŒ๋“ค๋Ÿฌ ๊ฐ€๊ธฐ
</StyledSection>

<StyledSection onClick={showIntro}>
์†Œ๊ฐœ๊ธ€ ๋ณด๊ธฐ
</StyledSection>

<StyledLogout onClick={logout}>๋กœ๊ทธ์•„์›ƒ</StyledLogout>
<hr />

Expand Down

0 comments on commit e3d2e37

Please sign in to comment.