Skip to content

Commit

Permalink
Merge branch 'Weekly' into Feat/issue-#33
Browse files Browse the repository at this point in the history
  • Loading branch information
Dobbymin authored Oct 5, 2024
2 parents c8c7ed6 + 700be4c commit 819bd3e
Show file tree
Hide file tree
Showing 19 changed files with 584 additions and 0 deletions.
25 changes: 25 additions & 0 deletions src/app/routes/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import ServiceHistoryPage from '@/pages/guard/service-history';
import HelloCallListPage from '@/pages/siniddo/hello-call/hello-call-list';
import HelloCallReportPage from '@/pages/siniddo/hello-call/hello-call-report';
import HelloCallServicePage from '@/pages/siniddo/hello-call/hello-call-service';
import CallBackDetailPage from '@/pages/siniddo/call-back/detail';
import CallBackListPage from '@/pages/siniddo/call-back/list';
import SiniddoGuideLinePage from '@/pages/siniddo/guide-line';
import MyPage from '@/pages/siniddo/mypage';

const router = createBrowserRouter([
Expand Down Expand Up @@ -43,6 +46,28 @@ const router = createBrowserRouter([
},
],
},
{
path: RouterPath.callBackList,
children: [
{
index: true,
element: <CallBackListPage />,
},
{
path: RouterPath.callBackDetail,
children: [
{
index: true,
element: <CallBackDetailPage />,
},
{
path: RouterPath.callBackGuidLine,
element: <SiniddoGuideLinePage />,
},
],
},
],
},
]);

export const Routes = () => {
Expand Down
3 changes: 3 additions & 0 deletions src/app/routes/path.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,7 @@ export const RouterPath = {
helloCallList: '/hello-call',
helloCallService: 'service',
helloCallReport: 'report',
callBackList: '/call-back',
callBackDetail: ':callBackId',
callBackGuidLine: ':guideLineId',
};
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
import { useNavigate, useLocation } from 'react-router-dom';

import ArrowImg from '../../assets/arrow-outline.png';
import { Button, Image } from '@chakra-ui/react';
import styled from '@emotion/styled';

type Props = {
title: string;
id: string;
backgroundColor: string;
};

export const GuideLineButton = ({ title, backgroundColor, id }: Props) => {
const navigate = useNavigate();
const location = useLocation();

const handleClick = () => {
navigate(`${location.pathname}/${id}`);
};

return (
<Wrapper backgroundColor={backgroundColor} onClick={handleClick}>
<Content>
<Title>{title}</Title>
<ArrowIcon src={ArrowImg} />
</Content>
</Wrapper>
);
};

const Wrapper = styled(Button)`
width: 100%;
height: 70px;
border-radius: 10px;
background-color: ${(props) =>
props.backgroundColor ? props.backgroundColor : '#81b6ff'};
outline: 0;
padding: 0;
margin-bottom: 10px;
`;

const Content = styled.div`
width: 100%;
display: flex;
align-items: center;
justify-content: center;
margin: 0 30px;
`;

const Title = styled.h2`
font-size: var(--font-size-xl);
font-weight: 500;
color: var(--color-white);
`;

const ArrowIcon = styled(Image)`
margin-left: auto;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { GUIDE_LINE_CATEGORIES } from '../../data/guide-line';
import { GuideLineButton } from './guide-line-button';
import styled from '@emotion/styled';

export const GuideLineList = () => {
return (
<Wrapper>
{GUIDE_LINE_CATEGORIES.map((data) => (
<GuideLineButton
key={data.id}
title={data.title}
id={data.id}
backgroundColor={data.backgroundColor}
/>
))}
</Wrapper>
);
};

const Wrapper = styled.div`
width: 100%;
margin-top: 50px;
margin-bottom: 30px;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import { BasicButton } from '@/shared/components/common/button';
import styled from '@emotion/styled';

type Props = {
handleComplete: () => void;
handleCancle: () => void;
phoneNumber: string;
};

export const PostAcceptMenu = ({
handleComplete,
handleCancle,
phoneNumber,
}: Props) => {
return (
<Wrapper>
<BasicButton onClick={handleComplete}>도움 μ™„λ£Œ</BasicButton>
<Space />
<BasicButton onClick={handleCancle} themeType='outline'>
도움 포기
</BasicButton>
<ContectSection>
<Title>μ‹œλ‹ˆμ–΄ μ „ν™”λ²ˆν˜Έ</Title>
<Content>{phoneNumber}</Content>
</ContectSection>
</Wrapper>
);
};

const Wrapper = styled.div`
width: 100%;
margin-top: 30px;
`;

const Space = styled.div`
width: 100%;
height: 10px;
`;

const ContectSection = styled.div`
margin-top: 30px;
width: 100%;
display: flex;
flex-direction: column;
align-items: center;
`;

const Title = styled.div`
width: 200px;
padding: 5px;
border-radius: 5px;
background-color: #f6e4e4;
font-size: var(--font-size-md);
font-weight: 400;
color: #c69090;
text-align: center;
`;

const Content = styled.p`
font-size: var(--font-size-xxl);
font-weight: 700;
margin-top: 10px;
`;
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { BasicButton } from '@/shared/components/common/button';
import styled from '@emotion/styled';

type Props = {
handleClcik: () => void;
};

export const PreAcceptMenu = ({ handleClcik }: Props) => {
return (
<Wrapper>
<BasicButton onClick={handleClcik}>μ „ν™”κ±ΈκΈ° 및 μˆ˜λ½ν•˜κΈ°</BasicButton>
</Wrapper>
);
};

const Wrapper = styled.div`
width: 100%;
margin-top: 30px;
`;
22 changes: 22 additions & 0 deletions src/pages/siniddo/call-back/detail/data/guide-line/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
export const GUIDE_LINE_CATEGORIES = [
{
title: 'νƒμ‹œ ν˜ΈμΆœν•˜κΈ°',
id: 'taxi',
backgroundColor: '#81b6ff',
},
{
title: 'λ“œλΌλ§ˆ λ°©μ˜μ‹œκ°„ μ•Œλ €μ£ΌκΈ°',
id: 'drama',
backgroundColor: '#b28bff',
},
{
title: 'μ„œλ₯˜ 제좜 도와주기',
id: 'document',
backgroundColor: '#ffa7b5',
},
{
title: 'λŒ€μ€‘κ΅ν†΅ 이동 도와주기',
id: 'document',
backgroundColor: '#ff4d68',
},
];
67 changes: 67 additions & 0 deletions src/pages/siniddo/call-back/detail/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import { useState } from 'react';
import { useParams, Outlet } from 'react-router-dom';

import { GuideLineList } from './components/guide-line-list';
import { PostAcceptMenu } from './components/menu/post-accept';
import { PreAcceptMenu } from './components/menu/pre-accept';
import { Precaution } from '@/shared/components/features/precaution';
import { Divider } from '@chakra-ui/react';
import styled from '@emotion/styled';

export type CallBackDetailParams = {
callBackId: string;
};

const CallBackDetailPage = () => {
const { callBackId = '' } = useParams<CallBackDetailParams>();
const [accept, setAccept] = useState(false);

console.log(callBackId);

const handleRequestAccept = () => {
// 도움 수락
setAccept(true);
};

const handleComplete = () => {
// 도움 μ™„λ£Œ
};

const handleCancle = () => {
// 도움 포기
};

return (
<>
<Wrapper>
<Precaution
category='μš”μ²­ κ±°λΆ€'
title='κ°€μ΄λ“œλΌμΈμ„ 잘 ν™•μΈν•˜κ³  μˆ˜λ½ν•΄μ£Όμ„Έμš”!'
description='μ‹œλ‹ˆμ–΄μ˜ μš”μ²­μ΄ κ°€μ΄λ“œλΌμΈμ—μ„œ λ²—μ–΄λ‚œ μš”μ²­μΌ 경우 μš”μ²­μ„ κ±°λΆ€ν•  수 μžˆμŠ΅λ‹ˆλ‹€!'
/>
<GuideLineList />
<Divider />
{accept ? (
<PostAcceptMenu
handleComplete={handleComplete}
handleCancle={handleCancle}
phoneNumber='010-1234-5678'
/>
) : (
<PreAcceptMenu handleClcik={handleRequestAccept} />
)}
</Wrapper>
<Outlet />
</>
);
};

export default CallBackDetailPage;

const Wrapper = styled.div`
min-height: 100vh;
display: flex;
flex-direction: column;
align-items: center;
padding: 45px;
`;
Binary file added src/pages/siniddo/call-back/list/assets/arrow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
62 changes: 62 additions & 0 deletions src/pages/siniddo/call-back/list/components/request-row/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
import { useNavigate } from 'react-router-dom';

import ArrowImg from '../../assets/arrow.png';
import styled from '@emotion/styled';

type Props = {
name: string;
time: number;
id: string;
};

export const RequestRow = ({ name, time, id }: Props) => {
const navigate = useNavigate();

const handleClick = () => {
navigate(`/call-back/${id}`);
};

return (
<Wrapper onClick={handleClick}>
<Content>
<Title>{name}λ‹˜μ˜ μš”μ²­</Title>
<Time>{time}λΆ„ μ „</Time>
<ArrowIcon src={ArrowImg} />
</Content>
</Wrapper>
);
};

const Wrapper = styled.button`
width: 100%;
height: 60px;
border-radius: 10px;
background-color: var(--color-white-gray);
outline: 0;
margin-bottom: 10px;
`;

const Content = styled.div`
display: flex;
align-items: center;
justify-content: center;
margin: 0 30px;
`;

const Title = styled.h3`
font-size: var(--font-size-lg);
font-weight: 400;
margin-top: 2px;
`;

const Time = styled.p`
font-size: var(--font-size-md);
font-weight: 350;
color: var(--color-gray);
margin-left: auto;
`;

const ArrowIcon = styled.img`
margin-left: 20px;
height: 20px;
`;
5 changes: 5 additions & 0 deletions src/pages/siniddo/call-back/list/data/mock/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export const MOCK_DATA = Array.from({ length: 10 }, () => ({
name: 'κΉ€μˆ™μž',
time: 50,
id: '1',
}));
Loading

0 comments on commit 819bd3e

Please sign in to comment.