Skip to content

Commit

Permalink
Feat : user modal 구현 loading height 수정 #10
Browse files Browse the repository at this point in the history
- 톱니바퀴 클릭시 modal창 나오게 구현
- largeMobile 반응형까지 구현
- loadin 페이지 height 100vh로 수정
  • Loading branch information
sheepdog13 committed Feb 4, 2024
1 parent c6ad83e commit e7ac32c
Show file tree
Hide file tree
Showing 4 changed files with 84 additions and 3 deletions.
Binary file added frontend/public/img/logout.webp
Binary file not shown.
Binary file added frontend/public/img/profile.webp
Binary file not shown.
2 changes: 1 addition & 1 deletion frontend/src/pages/Loading.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import MoonLoader from 'react-spinners/MoonLoader';

const Wapper = styled.div`
width: 100%;
height: 100%;
height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
Expand Down
85 changes: 83 additions & 2 deletions frontend/src/pages/Main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React from 'react';
import React, { useState } from 'react';
import styled from 'styled-components';
import { media } from '../style/mediaQuery';
import { useNavigate } from 'react-router-dom';
Expand All @@ -14,6 +14,7 @@ const Wrapper = styled.div`
`;

const Header = styled.div`
position: relative;
${media.largeMobile`
height: 40px;
padding: 10px;
Expand Down Expand Up @@ -66,6 +67,61 @@ const SkillImg = styled.img`
height: 25px;
`;

const UserModal = styled.div`
${media.largeMobile`
top: 41px;
padding: 10px;
`}
position: absolute;
top: 53px;
right: 4px;
padding: 15px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 15px;
border-radius: 5px;
border: 0.5px solid #d3d3d3;
background: #fff;
`;

const ModalBox = styled.div`
${media.largeMobile`
gap: 8px;
div {
font-size: 12px;
}
`}
display: flex;
flex-direction: row;
align-items: center;
gap: 10px;
`;

const ModalIconBox = styled.div<{ color: string }>`
${media.largeMobile`
width: 20px;
height: 20px;
`}
display: flex;
align-items: center;
justify-content: center;
width: 25px;
height: 25px;
border-radius: 50%;
background-color: ${(props) => props.color};
`;

const ModalImg = styled.img<{ size: string }>`
${media.largeMobile`
width: 12px;
height: 12px;
`}
width: ${(props) => props.size};
height: ${(props) => props.size};
`;

const LetText = styled.p`
${media.largeMobile`
margin-top: 55px;
Expand Down Expand Up @@ -183,6 +239,7 @@ const ReportBox = styled.div`

function Main() {
const navigate = useNavigate();
const [openModal, setOpenModal] = useState<boolean>(false);
return (
<Wrapper>
<Header>
Expand All @@ -193,12 +250,36 @@ function Main() {
>
<HomeImg src={`${process.env.PUBLIC_URL}/img/home.webp`} alt="home" />
</HomeBtn>
<Btn>
<Btn onClick={() => setOpenModal((pre) => !pre)}>
<SkillImg
src={`${process.env.PUBLIC_URL}/img/skill.webp`}
alt="skill"
/>
</Btn>
{openModal && (
<UserModal>
<ModalBox>
<ModalIconBox color="#FF2868">
<ModalImg
size="15px"
src={`${process.env.PUBLIC_URL}/img/logout.webp`}
alt="connect"
/>
</ModalIconBox>
<div>로그아웃</div>
</ModalBox>
<ModalBox>
<ModalIconBox color="#5562EA">
<ModalImg
size="15px"
src={`${process.env.PUBLIC_URL}/img/profile.webp`}
alt="connect"
/>
</ModalIconBox>
<div>회원정보</div>
</ModalBox>
</UserModal>
)}
</Header>
<LetText>Let’s Go</LetText>
<ProblemBox>
Expand Down

0 comments on commit e7ac32c

Please sign in to comment.