-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* env : react-spring-bottom-sheet - > alpha 버전으로 마이그레이션 * env : 필요 의존성 설치 * chore : 하위 컴포넌트 애니메이션 수정 * feat : form 개발 * feat : 폰트, 이미지 선택 기능 * refactor : 페이지 분리
- Loading branch information
Showing
12 changed files
with
417 additions
and
106 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import type { Meta, StoryObj } from '@storybook/react'; | ||
|
||
import { PostLetterForm } from './PostLetterForm'; | ||
|
||
const meta: Meta<typeof PostLetterForm> = { | ||
component: PostLetterForm, | ||
title: 'PostLetterForm', | ||
tags: ['autodocs'], | ||
argTypes: {}, | ||
decorators: [ | ||
(Story) => ( | ||
<div | ||
style={{ | ||
width: '375px', | ||
margin: '0 auto', | ||
border: '1px solid #ddd', | ||
padding: '16px', | ||
minHeight: '500px', // 최소 높이 추가 | ||
display: 'flex', | ||
flexDirection: 'column', // Flexbox로 하위 요소 정렬 | ||
justifyContent: 'center' // 하위 콘텐츠 중앙 정렬 | ||
}} | ||
> | ||
<Story /> | ||
</div> | ||
) | ||
] | ||
}; | ||
|
||
export default meta; | ||
|
||
type Story = StoryObj<typeof PostLetterForm>; | ||
|
||
export const Default: Story = { | ||
args: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,84 @@ | ||
import { ItemSlider } from '@/components/Common/ItemSlider/ItemSlider'; | ||
import { Margin } from '@/components/Common/Margin/Margin'; | ||
import { SliderMenuContainer } from '@/components/Common/SliderMenuContainer/SliderMenuContainer'; | ||
import { TextArea } from '@/components/Common/TextArea/TextArea'; | ||
import { Toggle } from '@/components/Common/Toggle/Toggle'; | ||
import { useState } from 'react'; | ||
|
||
export const PostLetterForm = () => { | ||
const [title, setTtile] = useState(''); | ||
const [content, setContent] = useState(''); | ||
const [isFont, setIsFont] = useState(true); | ||
const [letter, setLetter] = useState('편지지_샘플_1'); | ||
const [font, setFont] = useState(''); | ||
|
||
const textItems = [ | ||
{ name: 'cursive', id: '1' }, | ||
{ name: 'fantasy', id: '2' }, | ||
{ name: 'initial', id: '3' }, | ||
{ name: 'monospace', id: '4' } | ||
]; | ||
|
||
const imageItems = [ | ||
{ id: '편지지_샘플_1', name: '이미지' }, | ||
{ id: '편지지_샘플_2', name: '이미지' }, | ||
{ id: '편지지_샘플_3', name: '이미지' }, | ||
{ id: '편지지_샘플_4', name: '이미지' }, | ||
{ id: '편지지_샘플_5', name: '이미지' } | ||
]; | ||
|
||
return ( | ||
<SliderMenuContainer> | ||
<Margin top={18} /> | ||
<div> | ||
<div className="relative flex justify-center"> | ||
<input | ||
onChange={(e) => setTtile(e.target.value)} | ||
value={title} | ||
type="text" | ||
placeholder="제목을 입력해주세요" | ||
className="absolute mt-[35%] w-9/12 bg-transparent px-2 focus:border-none focus:outline-none border-none " | ||
/> | ||
<TextArea | ||
value={content} | ||
setValue={setContent} | ||
font={font} | ||
/> | ||
</div> | ||
|
||
<img | ||
src={`/public/${letter}.png`} | ||
className="w-full h-full rounded-lg " | ||
alt="샘플 편지지" | ||
/> | ||
|
||
<div className="flex flex-col items-center justify-center aling bottom-9 "> | ||
<Margin bottom={14} /> | ||
{isFont ? ( | ||
<ItemSlider | ||
itemType="text" | ||
itemIDList={textItems} | ||
value={font} | ||
setValue={setFont} | ||
/> | ||
) : ( | ||
<ItemSlider | ||
itemType="image" | ||
itemIDList={imageItems} | ||
width="77px" | ||
height="99px" | ||
value={letter} | ||
setValue={setLetter} | ||
/> | ||
)} | ||
<Margin bottom={14} /> | ||
<Toggle | ||
isChecked={isFont} | ||
onToggle={() => setIsFont(!isFont)} | ||
/> | ||
<Margin bottom={14} /> | ||
</div> | ||
</div> | ||
</SliderMenuContainer> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,16 @@ | ||
import { TopBar } from '@/components/Common/TopBar/TopBar'; | ||
import { PostLetterForm } from '@/components/Letter/Post/PostLetterForm'; | ||
import React from 'react'; | ||
|
||
export const CreateLetterPage = () => { | ||
return ( | ||
<div className="bg-slate-500 w-[375px] max-w-[768px] h-[815px]"></div> | ||
<div className=" w-[375px] max-w-[768px] h-[815px]"> | ||
<TopBar | ||
onClick={() => { | ||
alert('back~'); | ||
}} | ||
/> | ||
<PostLetterForm /> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters