Skip to content

Commit 006d79b

Browse files
committed
design:편지 작성 페이지 작업 시작
1 parent 843a062 commit 006d79b

File tree

5 files changed

+86
-1
lines changed

5 files changed

+86
-1
lines changed

src/assets/svg/test.svg

Lines changed: 3 additions & 0 deletions
Loading
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
function WritePageButton({ text, onClick }: { text: string; onClick: () => void }) {
2+
return (
3+
<button
4+
className="caption-sb bg-primary-3 text-gray-60 cursor-pointer rounded-[4px] px-2 py-1"
5+
onClick={onClick}
6+
>
7+
{text}
8+
</button>
9+
);
10+
}
11+
12+
export default WritePageButton;
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
function WritePageOptionSlide() {
2+
return (
3+
<div className="bg-primary-3 absolute bottom-0 left-0 h-110 w-full rounded-t-[20px]">
4+
<div className="bg-primary-1 absolute top-3 left-[50%] h-[3px] w-7.5 translate-x-[-50%] translate-y-[-50%]"></div>
5+
</div>
6+
);
7+
}
8+
9+
export default WritePageOptionSlide;

src/pages/Write/index.tsx

Lines changed: 53 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,57 @@
1+
import { useRef } from 'react';
2+
3+
import WritePageButton from './WritePageButton';
4+
import WritePageOptionSlide from './WritePageOptionSlide';
5+
16
const WritePage = () => {
2-
return <div>WritePage</div>;
7+
const textareaRef = useRef<HTMLTextAreaElement | null>(null);
8+
9+
const handleResizeHeight = () => {
10+
if (textareaRef.current !== null) {
11+
textareaRef.current.style.height = 'auto'; //height 초기화
12+
textareaRef.current.style.height = textareaRef.current.scrollHeight + 'px';
13+
}
14+
};
15+
16+
return (
17+
<div className="relative p-5">
18+
<WritePageOptionSlide />
19+
<div className="flex w-full justify-end gap-3">
20+
<WritePageButton
21+
text="연락 끊기"
22+
onClick={() => {
23+
console.log('연락 끊기');
24+
}}
25+
/>
26+
<WritePageButton
27+
text="작성 완료"
28+
onClick={() => {
29+
console.log('작성 완료');
30+
}}
31+
/>
32+
</div>
33+
<div className="flex flex-col gap-3 px-6">
34+
<div className="body-b mt-7 flex">
35+
<span>TO. </span>
36+
<span>{'12EE1'}</span>
37+
</div>
38+
<input
39+
type="text"
40+
placeholder="제목을 입력해주세요."
41+
className="body-sb placeholder:text-gray-40 placeholder:border-0 focus:outline-0"
42+
/>
43+
</div>
44+
<div className="mt-9">
45+
<textarea
46+
rows={20}
47+
className="body-r basic-theme h-auto w-full px-6 focus:outline-none"
48+
placeholder="클릭해서 내용을 작성하세요"
49+
onChange={handleResizeHeight}
50+
ref={textareaRef}
51+
></textarea>
52+
</div>
53+
</div>
54+
);
355
};
456

557
export default WritePage;

src/styles/utilities.css

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,13 @@
11
/* Tailwind에서 기본적으로 제공하지 않는 추가 유틀리티 클래스 정의 */
22

33
@layer utilities {
4+
/* 편지지 테마용 css */
5+
.basic-theme {
6+
background-attachment: local;
7+
background-image:
8+
linear-gradient(to right, white 10px, transparent 10px),
9+
linear-gradient(to left, white 10px, transparent 10px),
10+
repeating-linear-gradient(white, white 30px, #f8de8c 30px, #f8de8c 31px, white 31px);
11+
line-height: 31px;
12+
}
413
}

0 commit comments

Comments
 (0)