Skip to content

Commit 2562d7c

Browse files
committed
design:편지 상세보기 퍼블리싱
1 parent eeb8946 commit 2562d7c

File tree

7 files changed

+128
-1
lines changed

7 files changed

+128
-1
lines changed

src/assets/icons/cloud.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/color-siren.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/index.ts

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,23 @@ import EnvelopeIcon from './envelope.svg?react';
55
import PersonIcon from './person.svg?react';
66
import restartIcon from './restart.svg';
77
import SirenIcon from './siren.svg?react';
8+
import CloudIcon from './cloud.svg';
9+
import SnowIcon from './snow.svg';
10+
import ThermostatIcon from './thermostat.svg';
11+
import WarmIcon from './warm.svg';
12+
import ColorSirenIcon from './color-siren.svg';
813

9-
export { AlarmIcon, PersonIcon, ArrowLeftIcon, SirenIcon, EnvelopeIcon, BoardIcon, restartIcon };
14+
export {
15+
AlarmIcon,
16+
PersonIcon,
17+
ArrowLeftIcon,
18+
SirenIcon,
19+
EnvelopeIcon,
20+
BoardIcon,
21+
restartIcon,
22+
CloudIcon,
23+
SnowIcon,
24+
ThermostatIcon,
25+
WarmIcon,
26+
ColorSirenIcon,
27+
};

src/assets/icons/snow.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/thermostat.svg

Lines changed: 8 additions & 0 deletions
Loading

src/assets/icons/warm.svg

Lines changed: 8 additions & 0 deletions
Loading

src/components/LetterDetail.tsx

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { CloudIcon, ColorSirenIcon, SnowIcon, ThermostatIcon, WarmIcon } from '@/assets/icons';
2+
import { useState } from 'react';
3+
import { twMerge } from 'tailwind-merge';
4+
5+
export default function LetterDetail({ title, text }: { title: string; text: string }) {
6+
const FONT = '';
7+
const THEME = 'field';
8+
const [degreeModalOpen, setDegreeModalOpen] = useState<boolean>(false);
9+
return (
10+
<div className={twMerge(`flex grow flex-col gap-3 px-5 pb-7.5`, THEME)}>
11+
<div className="absolute top-5 right-5 flex gap-3">
12+
<button
13+
className="flex items-center justify-center gap-1"
14+
onClick={() => {
15+
setDegreeModalOpen(true);
16+
}}
17+
>
18+
<img src={ThermostatIcon} alt="편지 온도 아이콘" />
19+
<span className="caption-b text-primary-1">편지 온도</span>
20+
</button>
21+
<button onClick={() => {}}>
22+
<img src={ColorSirenIcon} alt="신고 아이콘" />
23+
</button>
24+
{degreeModalOpen && (
25+
<div className="caption-b text-primary-1 bg-primary-5 absolute top-7 z-40 flex flex-col gap-1 p-2 shadow">
26+
<button
27+
className="flex items-center justify-center gap-1"
28+
onClick={() => {
29+
setDegreeModalOpen(false);
30+
}}
31+
>
32+
<img src={WarmIcon} alt="따뜻 아이콘" /> 따뜻해요
33+
</button>
34+
<button
35+
className="flex items-center justify-center gap-1"
36+
onClick={() => {
37+
setDegreeModalOpen(false);
38+
}}
39+
>
40+
<img src={CloudIcon} alt="그럭저럭 아이콘" /> 그럭저럭
41+
</button>
42+
<button
43+
className="flex items-center justify-center gap-1"
44+
onClick={() => {
45+
setDegreeModalOpen(false);
46+
}}
47+
>
48+
<img src={SnowIcon} alt="차가움 아이콘" /> 앗! 차가워
49+
</button>
50+
</div>
51+
)}
52+
</div>
53+
<div className="flex flex-col gap-3 px-5">
54+
<span className="body-b mt-[55px]">TO. 따숨이</span>
55+
<span className="body-sb">{title}</span>
56+
</div>
57+
<textarea
58+
readOnly
59+
value={text}
60+
className={twMerge(
61+
`body-r basic-theme min-h-full w-full grow px-6 focus:outline-none`,
62+
`${FONT}`,
63+
)}
64+
></textarea>
65+
<span className="body-sb mt-10 flex justify-end">FROM. {'12E12'}</span>
66+
<button className="bg-primary-3 mt-3 w-full rounded-lg py-2">편지 작성하기</button>
67+
</div>
68+
);
69+
}

0 commit comments

Comments
 (0)