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

πŸ”€λ§ˆμ΄νŽ˜μ΄μ§€ μ œμž‘ #22

Open
wants to merge 15 commits into
base: develop
Choose a base branch
from
Open
6 changes: 6 additions & 0 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ import React from 'react';
import { Route, Routes } from 'react-router-dom';
import { Home, Write, InputPage, Temp, NoPage } from 'pages';
import Post from 'pages/post';
import My from 'pages/my';
import Edit from 'pages/my/edit';
import Cancle from 'pages/my/cancle';

function App() {
return (
Expand All @@ -12,6 +15,9 @@ function App() {
<Route path="/input" element={<InputPage />} />
<Route path="/temp" element={<Temp />} />
<Route path="/post/:id" element={<Post />} />
<Route path="/my" element={<My />} />
<Route path="/my/edit/:id" element={<Edit />} />
<Route path="/my/cancle/:id" element={<Cancle />} />
</Routes>
);
}
Expand Down
34 changes: 34 additions & 0 deletions src/components/Modal/ImageChange/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
import React from 'react';
import * as S from './style';
import XIcon from 'svg/XIcon';
import ChangeIcon from 'svg/ChangeIcon';

interface Props {
onClose: () => void;
}

const ImageChange = ({ onClose }: Props) => {
return (
<S.Wrapper>
<S.ProfileContainer>
<S.Header>
<S.Title>ν”„λ‘œν•„ λ³€κ²½</S.Title>
<div onClick={onClose}>
<XIcon />
</div>
</S.Header>
<S.ImageBack>
<label>
<S.Hidden type="file" />
<S.ChangeButton>
<ChangeIcon />
</S.ChangeButton>
</label>
</S.ImageBack>
</S.ProfileContainer>
<S.CheckButton>확인</S.CheckButton>
</S.Wrapper>
);
};

export default ImageChange;
73 changes: 73 additions & 0 deletions src/components/Modal/ImageChange/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
import styled from '@emotion/styled';

export const Wrapper = styled.div`
display: flex;
width: 400px;
padding: 24px;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 28px;
background-color: ${({ theme }) => theme.color.white};
border-radius: 8px;
`;

export const Header = styled.div`
display: flex;
justify-content: space-between;
align-items: flex-start;
align-self: stretch;
background-color: ${({ theme }) => theme.color.white};
`;

export const CloseButton = styled.div``;

export const Title = styled.div`
${({ theme }) => theme.fontStyle.m1.semi};
color: ${({ theme }) => theme.color.black};
`;

export const Hidden = styled.input`
display: none;
`;

export const ChangeButton = styled.div`
position: absolute;
top: 0;
right: 0;
width: 40px;
height: 40px;
border-radius: 0px 8px;
background: ${({ theme }) => theme.color.gray[400]};
display: flex;
justify-content: center;
align-items: center;
`;

export const ImageBack = styled.div`
position: relative;
width: 352px;
height: 345px;
border-radius: 8px;
background: ${({ theme }) => theme.color.gray[300]};
`;

export const CheckButton = styled.div`
padding: 10px 16px;
display: flex;
justify-content: center;
align-items: center;
align-self: stretch;
gap: 10px;
border-radius: 8px;
background-color: ${({ theme }) => theme.color.main};
color: ${({ theme }) => theme.color.white};
${({ theme }) => theme.fontStyle.m3.semi};
`;

export const ProfileContainer = styled.div`
display: flex;
flex-direction: column;
align-items: center;
gap: 16px;
`;
20 changes: 20 additions & 0 deletions src/components/My/CanclePage/PostHeader/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import React from 'react';
import * as S from './style';
import { LeftArrow } from 'svg';
import { useNavigate } from 'react-router-dom';

const PostHeader = () => {
const navigate = useNavigate();

return (
<S.Container>
<S.HomeButton onClick={() => navigate(`/my`)}>
<LeftArrow />
</S.HomeButton>
<S.Text>글보기</S.Text>
<S.Empty />
</S.Container>
);
};

export default PostHeader;
24 changes: 24 additions & 0 deletions src/components/My/CanclePage/PostHeader/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import styled from '@emotion/styled';

export const Container = styled.div`
max-width: 37.5rem;
width: 100%;
padding: 1rem 0.75rem;
display: flex;
justify-content: space-between;
align-items: center;
`;

export const HomeButton = styled.div`
cursor: pointer;
`;

export const Text = styled.p`
${({ theme }) => theme.fontStyle.m2}
color: ${({ theme }) => theme.color.gray[500]};
`;

export const Empty = styled.div`
width: 24px;
height: 25px;
`;
36 changes: 36 additions & 0 deletions src/components/My/CanclePage/PostProfile/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
import React, { useState } from 'react';
import * as S from './style';
import KebabIcon from 'svg/KebabIcon';

const PostProfile = () => {
const [modal, setModal] = useState<boolean>(false);
return (
<S.Wrapper>
<S.Profile>
<S.ProfileImg src={''} alt="" />
<S.ProfileText>
<S.Name>ν•œμž¬ν˜•</S.Name>
<S.Data>
<S.DataText>κ΄‘μ£Όμ†Œν”„νŠΈμ›¨μ–΄λ§ˆμ΄μŠ€ν„°κ³ λ“±ν•™κ΅</S.DataText>
<S.Dot />
<S.DataText>1ν•™λ…„</S.DataText>
<S.Dot />
<S.DataText>μ—¬μž</S.DataText>
</S.Data>
</S.ProfileText>
</S.Profile>
<S.ModalContainer>
<S.DetailButton onClick={() => setModal(!modal)}>
<KebabIcon />
</S.DetailButton>
{modal && (
<S.DetailModal>
<S.WarningText>κΈ€ μ‚­μ œ</S.WarningText>
</S.DetailModal>
)}
</S.ModalContainer>
</S.Wrapper>
);
};

export default PostProfile;
75 changes: 75 additions & 0 deletions src/components/My/CanclePage/PostProfile/style.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
import styled from '@emotion/styled';

export const Wrapper = styled.div`
display: flex;
justify-content: space-between;
`;

export const Profile = styled.div`
display: flex;
align-items: center;
gap: 0.75rem;
`;

export const ProfileImg = styled.img`
width: 3rem;
height: 3rem;
border-radius: 100%;
`;

export const ProfileText = styled.div`
display: flex;
flex-direction: column;
gap: 0.125rem;
`;

export const Name = styled.span`
${({ theme }) => theme.fontStyle.label};
color: ${({ theme }) => theme.color.gray[600]};
`;

export const Data = styled.div`
display: flex;
align-items: center;
gap: 0.25rem;
`;

export const DataText = styled.span`
${({ theme }) => theme.fontStyle.label};
color: ${({ theme }) => theme.color.gray[500]};
`;

export const Dot = styled.div`
width: 0.25rem;
height: 0.25rem;
border-radius: 0.125rem;
background-color: #b4b5b7;
`;

export const ModalContainer = styled.div`
position: relative;
display: flex;
justify-content: center;
align-items: center;
`;

export const DetailButton = styled.div``;

export const DetailModal = styled.div`
position: absolute;
left: -78px;
top: 40px;
display: inline-flex;
padding: 24px;
flex-direction: column;
align-items: flex-start;
gap: 32px;
border-radius: 8px;
background: ${({ theme }) => theme.color.white};
box-shadow: 0px 0px 20px 0px rgba(0, 0, 0, 0.08);
`;

export const WarningText = styled.div`
${({ theme }) => theme.fontStyle.m3.reg}
color: ${({ theme }) => theme.color.system};
`;
55 changes: 55 additions & 0 deletions src/components/My/CanclePage/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
import React, { useState } from 'react';
import * as S from './style';
import Profile from './PostProfile';
import MateList from 'components/MateList';
import { ReportIcon } from 'svg';
import { DeclarationModal } from 'components/Modal';
import TagList from '../PostList/PostCard/TagList';
import PostHeader from './PostHeader';

const CanclePage = () => {
const [modal, setModal] = useState<boolean>(false);
return (
<>
<PostHeader />
<S.Container>
<S.PostContainer>
<S.ApplyContainer>
<Profile />
<S.PostText>
<S.Title>같이 μ‚°μ±… ν•˜μ‹€ λΆ„ κ΅¬ν•΄μš”</S.Title>
<S.Content>
ν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν• 
μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν• 
μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν• 
μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν• 
μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν• 
μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒν† μš”μΌμ— ν˜Έμˆ˜κ³΅μ› μ‚°μ±…ν•  μ‚¬λžŒ
</S.Content>
</S.PostText>
<S.SNSContainer>
<S.SNSText>카톑 : wjdtjffl55</S.SNSText>
<S.SNSText>λ””μŠ€μ½”λ“œ : hye_2417</S.SNSText>
<S.SNSText>μΈμŠ€νƒ€κ·Έλž¨ : hye_2417</S.SNSText>
</S.SNSContainer>
<S.Deadline>마감일 : 2024λ…„ 06μ›” 17일</S.Deadline>
<S.PostData>
<S.Remain>2자리 λ‚¨μŒ</S.Remain>
<MateList gender={'MALE'} grade={['ANY']} />
<S.TagReportContainer>
<TagList tag={['EXERCISE', 'STUDY']} />
<S.ReportButton onClick={() => setModal(true)}>
<ReportIcon />
</S.ReportButton>
</S.TagReportContainer>
</S.PostData>
</S.ApplyContainer>
</S.PostContainer>
<S.CancleButton>μ‹ μ²­ μ·¨μ†Œ</S.CancleButton>
</S.Container>
{modal && <DeclarationModal onClose={() => setModal(false)} postId={1} />}
</>
);
};

export default CanclePage;
Loading