-
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.
* chore : 폴더 경로 수정 * refactor: 편지 작성 폼 분리 * refacotor : 아이템 선택 페이지 리펙토링 * refactor: hook index.ts로 분리 * story : story 오류 수정
- Loading branch information
Showing
24 changed files
with
204 additions
and
100 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
57 changes: 57 additions & 0 deletions
57
src/components/CreatLetterPage/LettetInputForm/LettetInputForm.tsx
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,57 @@ | ||
import { Margin } from '@/components/Common/Margin/Margin'; | ||
import { TextArea } from '@/components/Common/TextArea/TextArea'; | ||
import { SelectSlider } from '@/components/SelectItemPage/SelectSlider/SelectSlider'; | ||
import React from 'react'; | ||
|
||
type LettetProps = { | ||
title: string; // 제목 | ||
handleChange: (e: React.ChangeEvent<HTMLInputElement>) => void; // 제목 변경 핸들러 | ||
letterContent: string; // 편지 내용 | ||
setLetterContent: React.Dispatch<React.SetStateAction<string>>; // 편지 내용 상태 변경 함수 | ||
font: string; // 글꼴 | ||
letter: string; // 선택된 편지지 | ||
setFont: React.Dispatch<React.SetStateAction<string>>; // 글꼴 상태 변경 함수 | ||
setLetter: React.Dispatch<React.SetStateAction<string>>; // 편지지 상태 변경 함수 | ||
}; | ||
|
||
export const LettetInputForm = ({ | ||
title, | ||
handleChange, | ||
letterContent, | ||
setLetterContent, | ||
font, | ||
letter, | ||
setFont, | ||
setLetter | ||
}: LettetProps) => { | ||
return ( | ||
<div className="min-h-screen rounded-t-3xl bg-zinc-300"> | ||
<Margin top={20} /> | ||
<div className="relative flex flex-col justify-center w-9/12 m-auto py-9"> | ||
<input | ||
onChange={handleChange} | ||
value={title} | ||
type="text" | ||
placeholder="제목을 입력해주세요" | ||
className="z-10 w-full bg-transparent border-none focus:border-none focus:outline-none text-wrap" | ||
style={{ fontFamily: font || 'inherit' }} | ||
/> | ||
<img src={'/public/to_line.f4c129e6.svg'} /> | ||
|
||
<div className="relative z-10"> | ||
<TextArea | ||
value={letterContent} | ||
setValue={setLetterContent} | ||
font={font} | ||
/> | ||
</div> | ||
</div> | ||
<SelectSlider | ||
font={font} | ||
letter={letter} | ||
setFont={setFont} | ||
setLetter={setLetter} | ||
/> | ||
</div> | ||
); | ||
}; |
Empty file.
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
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
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,44 @@ | ||
import React from 'react'; | ||
import { LabelList } from '../LabelList/LabelList'; | ||
import { KeywordList } from '../KeywordList/KeywordList'; | ||
import { LabelProps } from '@/types/label'; | ||
|
||
type ItemGroupProps = { | ||
isLabel: boolean; | ||
labels: LabelProps[]; | ||
onLabelSelect: (label: number) => void; | ||
selectedLabels: number | null; | ||
keywordProps: { | ||
title: string; | ||
subTitle: string; | ||
keywordGroup: { content: string }[]; | ||
}; | ||
onKeywordSelect: (keyword: number) => void; | ||
selectedKeywords: number[]; | ||
}; | ||
|
||
export const ItemGroup: React.FC<ItemGroupProps> = ({ | ||
isLabel, | ||
labels, | ||
onLabelSelect, | ||
selectedLabels, | ||
keywordProps, | ||
onKeywordSelect, | ||
selectedKeywords | ||
}) => { | ||
return isLabel ? ( | ||
<LabelList | ||
labels={labels} | ||
onLabelSelect={onLabelSelect} | ||
selectedLabels={selectedLabels} | ||
/> | ||
) : ( | ||
<KeywordList | ||
title={keywordProps.title} | ||
subTitle={keywordProps.subTitle} | ||
keywordGroup={keywordProps.keywordGroup} | ||
onKeywordSelect={onKeywordSelect} | ||
selectedKeywords={selectedKeywords} | ||
/> | ||
); | ||
}; |
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
File renamed without changes.
File renamed without changes.
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
File renamed without changes.
34 changes: 34 additions & 0 deletions
34
src/components/SelectItemPage/SelectToggle/SelectToggle.tsx
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,34 @@ | ||
import React from 'react'; | ||
|
||
type SelectToggleProps = { | ||
isLabel: boolean; | ||
setIsLabel: React.Dispatch<React.SetStateAction<boolean>>; | ||
}; | ||
|
||
export const SelectToggle: React.FC<SelectToggleProps> = ({ | ||
isLabel, | ||
setIsLabel | ||
}) => { | ||
return ( | ||
<div className="relative flex w-full overflow-hidden text-xl align-middle h-[50px] "> | ||
<div | ||
className="absolute bottom-0 w-1/2 h-[2px] transition-transform duration-500 ease-in-out bg-sample-blue" | ||
style={{ | ||
transform: `translateX(${isLabel ? '0%' : '100%'})` | ||
}} | ||
></div> | ||
<div | ||
className="flex items-center justify-center flex-1 h-full cursor-pointer" | ||
onClick={() => setIsLabel(true)} | ||
> | ||
<span>라벨</span> | ||
</div> | ||
<div | ||
className="flex items-center justify-center flex-1 h-full cursor-pointer" | ||
onClick={() => setIsLabel(false)} | ||
> | ||
<span>키워드</span> | ||
</div> | ||
</div> | ||
); | ||
}; |
File renamed without changes.
File renamed without changes.
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,17 @@ | ||
import { useAutoSave } from './useAutoSave'; | ||
import { useDebounce } from './useDebounde'; | ||
import { useLocalStorage } from './useLocalStorage'; | ||
import { useModal } from './useModal'; | ||
import useNominatimSearch from './useNominatimSearch'; | ||
import { useRegisterForm } from './useRegisterForm'; | ||
import { useToastStore } from './useToastStore'; | ||
|
||
export { | ||
useAutoSave, | ||
useDebounce, | ||
useLocalStorage, | ||
useModal, | ||
useNominatimSearch, | ||
useRegisterForm, | ||
useToastStore | ||
}; |
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
Oops, something went wrong.