Skip to content

Commit b6fb4d7

Browse files
authored
Merge pull request #85 from Duri-Salon/fix(duri)/duri-ui
[feat] 통계 페이지 막대 그래프 구현, 잘못된 padding 및 ui 수정
2 parents 1536ecd + 7bf098f commit b6fb4d7

File tree

9 files changed

+396
-39
lines changed

9 files changed

+396
-39
lines changed

apps/duri/src/components/home/Home.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import { SetStateAction, useState } from 'react';
22
import React from 'react';
33

44
import { Button, Flex, HeightFitFlex, Text, theme } from '@duri-fe/ui';
5+
import { getShortenedAddress } from '@duri-fe/utils';
56
import styled from '@emotion/styled';
67
import { differenceInDays } from 'date-fns';
78
import {
@@ -45,7 +46,7 @@ const CarouselHome = ({
4546
<UpcomingReservation
4647
reservationDate={upcomingReservation.reservationDate}
4748
shopId={upcomingReservation.shopId}
48-
address={upcomingReservation.address}
49+
address={getShortenedAddress(upcomingReservation.address)}
4950
name={upcomingReservation.name}
5051
imageURL={upcomingReservation.imageURL}
5152
price={upcomingReservation.price}

apps/duri/src/components/home/reservation/UpcomingReservation.tsx

+16-7
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ const UpcomingReservation = ({
4747
navigate(`/shop/${shopId}`);
4848
};
4949

50-
const formatReservationDate = (reservationDate: string): string => {
50+
const formatReservationDate = (reservationDate: string) => {
5151
if (!reservationDate) return '예약 정보 없음';
5252

5353
// 날짜와 시간 분리
@@ -61,7 +61,14 @@ const UpcomingReservation = ({
6161
// 날짜 변환 (YYYY-MM-DD → YYYY.MM.DD)
6262
const formattedDate = datePart.replace(/-/g, '.');
6363

64-
return `${formattedDate} ${period} ${formattedHour}시`;
64+
return (
65+
<ReservationText typo="Label2" colorCode={theme.palette.Normal800}>
66+
<span>{formattedDate}</span>{' '}
67+
<span>
68+
{period} {formattedHour}
69+
</span>
70+
</ReservationText>
71+
);
6572
};
6673

6774
return (
@@ -116,7 +123,7 @@ const UpcomingReservation = ({
116123
padding="6px 26px"
117124
bg={theme.palette.Gray20}
118125
fontColor={theme.palette.Gray500}
119-
typo="Caption2"
126+
typo="Caption3"
120127
onClick={handleClickTelButton}
121128
>
122129
전화하기
@@ -128,7 +135,7 @@ const UpcomingReservation = ({
128135
padding="6px 26px"
129136
bg={theme.palette.Gray20}
130137
fontColor={theme.palette.Gray500}
131-
typo="Caption2"
138+
typo="Caption3"
132139
onClick={handleClickChatButton}
133140
>
134141
문의하기
@@ -142,9 +149,7 @@ const UpcomingReservation = ({
142149
margin="12px 0 0 0"
143150
padding="12px 27px"
144151
>
145-
<Text typo="Label2" colorCode={theme.palette.Normal800}>
146-
{formatReservationDate(reservationDate)}
147-
</Text>
152+
{formatReservationDate(reservationDate)}
148153
<Text typo="Label2" colorCode={theme.palette.Normal800}>
149154
{price ? `${price.toLocaleString()} 원` : '가격 정보 없음'}
150155
</Text>
@@ -182,3 +187,7 @@ const ImageBox = styled(WidthFitFlex)`
182187
const ShopWrapper = styled(Flex)`
183188
cursor: pointer;
184189
`;
190+
191+
const ReservationText = styled(Text)`
192+
gap: 10px;
193+
`;

apps/duri/src/pages/Diary/DiaryDetail.tsx

+47-26
Original file line numberDiff line numberDiff line change
@@ -69,17 +69,22 @@ const PetDiaryDetail = () => {
6969
<Flex padding="16px 22px" justify="space-between">
7070
<Text typo="Title3">시술날짜</Text>
7171
<Text typo="Body2" css={LightBody2}>
72-
2024-12-26
72+
{diaryDetailData.groomingDate}
7373
</Text>
7474
</Flex>
7575
<Seperator />
7676

7777
<Flex padding="16px 22px" justify="space-between">
7878
<Text typo="Title3">담당자</Text>
7979
<WidthFitFlex gap={12}>
80-
<ProfileImage width={20} height={20} borderRadius={99} />
80+
<ProfileImage
81+
width={20}
82+
height={20}
83+
borderRadius={99}
84+
src={diaryDetailData.groomerInfo.profileImageUrl}
85+
/>
8186
<Text typo="Body2" css={LightBody2}>
82-
미나쌤
87+
{diaryDetailData.groomerInfo.name}
8388
</Text>
8489
</WidthFitFlex>
8590
</Flex>
@@ -95,29 +100,41 @@ const PetDiaryDetail = () => {
95100
<Text typo="Caption1" colorCode={theme.palette.Gray400}>
96101
미용사님이 작성하신 미용 일지에요
97102
</Text>
98-
<Flex gap={4} justify="flex-start" margin="4px 0 0 0">
99-
<SalonTag
100-
height={23}
101-
content={diaryDetailData.friendly}
102-
bg={theme.palette.Normal100}
103-
colorCode={theme.palette.Normal700}
104-
typo="Label2"
105-
/>
106-
<SalonTag
107-
height={23}
108-
content={diaryDetailData.reaction}
109-
bg={theme.palette.Normal100}
110-
colorCode={theme.palette.Normal700}
111-
typo="Label2"
112-
/>
113-
<SalonTag
114-
height={23}
115-
content={diaryDetailData.behavior}
116-
bg={theme.palette.Normal100}
117-
colorCode={theme.palette.Normal700}
118-
typo="Label2"
119-
/>
120-
</Flex>
103+
<TagListFlex gap={4} justify="flex-start" margin="4px 0 0 0">
104+
<Flex justify="space-between">
105+
<Text typo="Label2">🥰 미용사와의 친화력</Text>
106+
<SalonTag
107+
height={23}
108+
content={diaryDetailData.friendly}
109+
bg={theme.palette.Normal100}
110+
colorCode={theme.palette.Normal700}
111+
typo="Label3"
112+
padding="10px"
113+
/>
114+
</Flex>
115+
<Flex justify="space-between">
116+
<Text typo="Label2">✂️ 미용도구 반응</Text>
117+
<SalonTag
118+
height={23}
119+
content={diaryDetailData.reaction}
120+
bg={theme.palette.Normal100}
121+
colorCode={theme.palette.Normal700}
122+
typo="Label3"
123+
padding="10px"
124+
/>
125+
</Flex>
126+
<Flex justify="space-between">
127+
<Text typo="Label2">🐶 행동 밎 짖음</Text>
128+
<SalonTag
129+
height={23}
130+
content={diaryDetailData.behavior}
131+
bg={theme.palette.Normal100}
132+
colorCode={theme.palette.Normal700}
133+
typo="Label3"
134+
padding="10px"
135+
/>
136+
</Flex>
137+
</TagListFlex>
121138
</Flex>
122139
<Seperator height="5px" />
123140
<RelativeFlex padding="25px 20px 117px 20px">
@@ -152,3 +169,7 @@ const TapeWrapper = styled.div`
152169
transform: translateX(-50%);
153170
z-index: 10;
154171
`;
172+
173+
const TagListFlex = styled(Flex)`
174+
flex-wrap: wrap;
175+
`;

apps/duri/src/pages/Diary/index.tsx

+8-5
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,9 @@ const PetDiary = () => {
1818

1919
return (
2020
<RelativeMobile backgroundColor={theme.palette.Gray_White}>
21-
<AbsoluteHeader title="일지" iconColor={theme.palette.White} />
22-
<Flex
21+
<AbsoluteHeader title="미용 일기" iconColor={theme.palette.White} />
22+
<HalfBorderRadius
2323
backgroundColor={theme.palette.Normal500}
24-
borderRadius={12}
2524
margin="-70px 0 0 0"
2625
padding="70px 28px 26px 28px"
2726
>
@@ -31,7 +30,7 @@ const PetDiary = () => {
3130
backgroundColor={theme.palette.Normal300}
3231
direction="column"
3332
align="start"
34-
padding="24px 33px"
33+
padding="24px 26px"
3534
gap={21}
3635
>
3736
<Text typo="Title2">미용 레포트</Text>
@@ -68,7 +67,7 @@ const PetDiary = () => {
6867
</Flex>
6968
</HeightFitFlex>
7069
</Flex>
71-
</Flex>
70+
</HalfBorderRadius>
7271

7372
<Flex padding="32px 20px 124px 20px" direction="column" gap={32}>
7473
{historyData && historyData.length > 0 ? (
@@ -127,3 +126,7 @@ const AbsoluteHeader = styled(Header)`
127126
const BorderLeftFlex = styled(Flex)`
128127
border-left: 3px solid ${theme.palette.Gray50};
129128
`;
129+
130+
const HalfBorderRadius = styled(Flex)`
131+
border-radius: 0 0 12px 12px;
132+
`;

packages/ui/src/assets/Max.tsx

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import * as React from 'react';
2+
const SvgMax = (props: React.SVGProps<SVGSVGElement>) => (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
fill="none"
6+
viewBox="0 0 43 32"
7+
{...props}
8+
>
9+
<g filter="url(#Max_svg__a)">
10+
<path
11+
fill="#F0FC98"
12+
fillRule="evenodd"
13+
d="M12 4a8 8 0 0 0-8 8v4a8 8 0 0 0 8 8h7.434L22 28l2.566-4H31a8 8 0 0 0 8-8v-4a8 8 0 0 0-8-8z"
14+
clipRule="evenodd"
15+
/>
16+
<path
17+
fill="#BBD029"
18+
d="M15.523 14.121v1.711c.92-.047 1.846-.129 2.72-.258l.105.961c-2.38.434-4.922.457-6.785.457l-.165-1.055c.827-.005 1.8-.011 2.825-.046v-1.77zM17.81 9.75v1.055h-2.262c.058 1.13.955 2.15 2.555 2.554l-.598 1.02c-1.254-.34-2.15-1.072-2.625-2.016-.469.996-1.354 1.758-2.613 2.098l-.621-.984c1.6-.44 2.478-1.483 2.554-2.672h-2.238V9.75h2.262V8.543h1.3V9.75zm2.367-1.3v10.605h-1.301V8.449zm10.664 0v10.593h-1.242v-5.402h-1.196v4.863h-1.195V8.648h1.195v3.95h1.196V8.449zm-4.828 1.253v1.055h-2.649v4.71c1.155-.011 2.104-.07 3.176-.269l.094 1.067c-1.277.257-2.39.293-3.867.304h-.715V9.703z"
19+
/>
20+
</g>
21+
<defs>
22+
<filter
23+
id="Max_svg__a"
24+
width={43}
25+
height={32}
26+
x={0}
27+
y={0}
28+
colorInterpolationFilters="sRGB"
29+
filterUnits="userSpaceOnUse"
30+
>
31+
<feFlood floodOpacity={0} result="BackgroundImageFix" />
32+
<feColorMatrix
33+
in="SourceAlpha"
34+
result="hardAlpha"
35+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
36+
/>
37+
<feOffset />
38+
<feGaussianBlur stdDeviation={2} />
39+
<feComposite in2="hardAlpha" operator="out" />
40+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" />
41+
<feBlend
42+
in2="BackgroundImageFix"
43+
result="effect1_dropShadow_3254_6761"
44+
/>
45+
<feBlend
46+
in="SourceGraphic"
47+
in2="effect1_dropShadow_3254_6761"
48+
result="shape"
49+
/>
50+
</filter>
51+
</defs>
52+
</svg>
53+
);
54+
export default SvgMax;

packages/ui/src/assets/Min.tsx

+54
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
import * as React from 'react';
2+
const SvgMin = (props: React.SVGProps<SVGSVGElement>) => (
3+
<svg
4+
xmlns="http://www.w3.org/2000/svg"
5+
fill="none"
6+
viewBox="0 0 43 32"
7+
{...props}
8+
>
9+
<g filter="url(#Min_svg__a)">
10+
<path
11+
fill="#F0FC98"
12+
fillRule="evenodd"
13+
d="M12 4a8 8 0 0 0-8 8v4a8 8 0 0 0 8 8h7.434L22 28l2.566-4H31a8 8 0 0 0 8-8v-4a8 8 0 0 0-8-8z"
14+
clipRule="evenodd"
15+
/>
16+
<path
17+
fill="#BBD029"
18+
d="M15.523 14.121v1.711c.92-.047 1.846-.129 2.72-.258l.105.961c-2.38.434-4.922.457-6.785.457l-.165-1.055c.827-.005 1.8-.011 2.825-.046v-1.77zM17.81 9.75v1.055h-2.262c.058 1.13.955 2.15 2.555 2.554l-.598 1.02c-1.254-.34-2.15-1.072-2.625-2.016-.469.996-1.354 1.758-2.613 2.098l-.621-.984c1.6-.44 2.478-1.483 2.554-2.672h-2.238V9.75h2.262V8.543h1.3V9.75zm2.367-1.3v10.605h-1.301V8.449zm11.226 8.226v1.055h-9.68v-1.055h4.15v-2.45h1.288v2.45zm-4.207-6.809c0 1.606 1.606 3.188 3.832 3.54l-.562 1.077c-1.793-.34-3.258-1.365-3.961-2.754-.703 1.383-2.156 2.426-3.938 2.754l-.562-1.078c2.215-.351 3.797-1.945 3.808-3.539v-.773h1.383z"
19+
/>
20+
</g>
21+
<defs>
22+
<filter
23+
id="Min_svg__a"
24+
width={43}
25+
height={32}
26+
x={0}
27+
y={0}
28+
colorInterpolationFilters="sRGB"
29+
filterUnits="userSpaceOnUse"
30+
>
31+
<feFlood floodOpacity={0} result="BackgroundImageFix" />
32+
<feColorMatrix
33+
in="SourceAlpha"
34+
result="hardAlpha"
35+
values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 127 0"
36+
/>
37+
<feOffset />
38+
<feGaussianBlur stdDeviation={2} />
39+
<feComposite in2="hardAlpha" operator="out" />
40+
<feColorMatrix values="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0.1 0" />
41+
<feBlend
42+
in2="BackgroundImageFix"
43+
result="effect1_dropShadow_3254_6767"
44+
/>
45+
<feBlend
46+
in="SourceGraphic"
47+
in2="effect1_dropShadow_3254_6767"
48+
result="shape"
49+
/>
50+
</filter>
51+
</defs>
52+
</svg>
53+
);
54+
export default SvgMin;

packages/ui/src/assets/index.tsx

+6
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@ export { default as Save } from './Save';
8484
export { default as LinkIcon } from './LinkIcon';
8585
export { default as ToggleDisable } from './ToggleDisable';
8686
export { default as ToggleEnable } from './ToggleEnable';
87+
export { default as Max } from './Max';
88+
export { default as Min } from './Min';
8789

8890
import Add from './Add';
8991
import AddNew from './AddNew';
@@ -125,7 +127,9 @@ import Location from './Location';
125127
import LocationShop from './LocationShop';
126128
import Lock from './Lock';
127129
import Magnifier from './Magnifier';
130+
import Max from './Max';
128131
import Menu from './Menu';
132+
import Min from './Min';
129133
import MyLocation from './MyLocation';
130134
import Notification from './Notification';
131135
import PaymentSuccess from './PaymentSuccess';
@@ -227,6 +231,8 @@ export const icons = {
227231
UploadIcon,
228232
Save,
229233
LinkIcon,
234+
Max,
235+
Min,
230236
};
231237

232238
export default icons;

0 commit comments

Comments
 (0)