Skip to content

Commit

Permalink
feat, style: 리스트 보기일때 메뉴버튼 숨기기, 메뉴모달 변경
Browse files Browse the repository at this point in the history
Co-authored-by: ChanWoo Kim <[email protected]>
Co-authored-by: Mina Seo <[email protected]>

리스트 보기시 메뉴버튼 숨김
메뉴모달 스타일 변경
  • Loading branch information
5nxtnxtnxt committed Dec 5, 2023
1 parent 0f55efc commit b4fd904
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 9 deletions.
2 changes: 1 addition & 1 deletion front/src/pages/Main/ListMsgs.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ const ListMsgs = (props: ListMsgProps) => {
<>
{messages.length > 0 ? (
<>
<Prev set={props.set} />{' '}
<Prev set={props.set} />
<StyledList>
<StyledListWrap>
{messages.map((msg, idx) => {
Expand Down
13 changes: 8 additions & 5 deletions front/src/pages/Main/MainButtonBox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,11 +95,14 @@ const MainButtonBox = (props: MainButtonBoxProps) => {
<HeaderText Ref={headerRef} userName={userData.nickname} />
</Container>

<StyledMenu
ref={menuRef}
src={'/icons/menu.svg'}
onClick={() => setMenuModal(true)}
/>
{list ? null : (
<StyledMenu
ref={menuRef}
src={'/icons/menu.svg'}
onClick={() => setMenuModal(true)}
/>
)}

{menuModal ? <MenuModal set={setMenuModal} list={setList} /> : null}

<StyledScreen
Expand Down
13 changes: 11 additions & 2 deletions front/src/pages/Main/MenuModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@ const StyledModal = styled.div`
top: 4%;
right: 0;
width: 40%;
background-color: rgba(0, 0, 0, 0.3);
background-color: #161616;
border-radius: 0.625rem 0 0 0.625rem;
box-shadow: 0 0.625rem 1.25rem rgba(255, 255, 255, 0.25),
0 0.625rem 1.25rem rgba(255, 255, 255, 0.25);
font: ${props => props.theme.font['--normal-main-header-font']};
Expand All @@ -32,7 +33,7 @@ const StyledUser = styled(StyledSection)`

const StyledLogout = styled(StyledSection)`
color: ${props => props.theme.colors['--primary-red-primary']};
font-family: 'Pretendard-Regular';
font-weight: bold;
`;

Expand All @@ -50,6 +51,10 @@ const MenuModal = (props: ModalProps) => {
const userName = mock.user_data.nickname;
const navigate = useNavigate();

const makeNewSnowBall = () => {
navigate('/make/snowball');
};

return (
<StyledModal>
<StyledUser>{userName}</StyledUser>
Expand All @@ -64,6 +69,10 @@ const MenuModal = (props: ModalProps) => {
편지 리스트로 보기
</StyledSection>

<StyledSection onClick={makeNewSnowBall}>
새로운 스노우볼 만들러 가기
</StyledSection>

<StyledLogout onClick={() => Logout(navigate)}>로그아웃</StyledLogout>
<hr />

Expand Down
8 changes: 7 additions & 1 deletion front/src/pages/Make/Snowball/MainDeco/MakeButton.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { useState, useContext } from 'react';
import { useNavigate } from 'react-router-dom';
import axios from 'axios';
import styled from 'styled-components';
import { LongButton } from '@utils';
Expand Down Expand Up @@ -30,6 +31,7 @@ const StyledAlert = styled.div`
`;

const MakeButton = (props: ButtonProps) => {
const navigate = useNavigate();
const { snowballName, mainDecoID, mainColor, bottomID, bottomColor } =
useContext(DecoContext);
const [alert, setAlert] = useState(false);
Expand All @@ -52,7 +54,11 @@ const MakeButton = (props: ButtonProps) => {
axios
.post('/api/snowball', snowballInfo, { withCredentials: true })
.then(res => {
console.log(res); // 뒤에 로직이 없 보냈는데 -> 데이터 최신화가 안됨 지금 // 여기도 데이터 요청 있으면 굳이 건들필요는 없기
console.log(res);
})
.catch(e => {
console.error(e);
navigate('/');
});

props.view[1](!props.view[0]);
Expand Down

0 comments on commit b4fd904

Please sign in to comment.