Skip to content

Commit

Permalink
[Feat] 한 줄 소개 필드 추가 (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
he2e2 authored Nov 30, 2024
1 parent 456ebad commit e369392
Show file tree
Hide file tree
Showing 6 changed files with 43 additions and 1 deletion.
1 change: 1 addition & 0 deletions src/features/archive/archive.dto.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import type { ApiResponse } from '@/shared/api';
export interface BaseArchiveDTO {
title: string;
description: string;
introduction: string;
type: Color;
canComment: boolean;
tags: { content: string }[];
Expand Down
1 change: 1 addition & 0 deletions src/features/archive/model/archive.store.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ interface ArchiveStore {
export const initialArchiveState: BaseArchiveDTO = {
title: '',
description: '',
introduction: '',
type: 'red',
canComment: false,
tags: [],
Expand Down
1 change: 1 addition & 0 deletions src/mocks/handlers/archive.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ export const archiveHandlers = [
title: '제목',
description:
'# h1\n## h2\n### 하이하이\n예제 **만드는** 중\n어떻게 _보일지_\n> 인용\n\n```\ncode\n```\n\n',
introduction: '소개',
type: 'red',
canComment: true,
tags: [{ content: '태그' }, { content: '태그2' }, { content: '태그3' }],
Expand Down
15 changes: 15 additions & 0 deletions src/widgets/DetailArchive/DetailHeader.module.scss
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,18 @@
display: flex;
gap: 0.5rem;
}

.intro {
display: flex;
gap: 0.5rem;
align-items: center;
padding: 1rem;
font-size: 1rem;
font-style: normal;
font-weight: 400;
line-height: 131%;
color: $primary-color;
white-space: wrap;
border: 1px solid #e9e9e9;
border-radius: 8px;
}
13 changes: 12 additions & 1 deletion src/widgets/DetailArchive/DetailHeader.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
import { faChevronRight, faCommentDots, faEye, faHeart } from '@fortawesome/free-solid-svg-icons';
import {
faChevronRight,
faCommentDots,
faEye,
faFeather,
faHeart,
} from '@fortawesome/free-solid-svg-icons';
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
import { useNavigate } from 'react-router-dom';

Expand All @@ -18,6 +24,7 @@ export const DetailHeader = ({ archive, archiveId }: { archive: Archive; archive
setArchiveData({
title: archive.title,
description: archive.description,
introduction: archive.introduction,
type: archive.type,
canComment: archive.canComment,
tags: archive.tags,
Expand Down Expand Up @@ -80,6 +87,10 @@ export const DetailHeader = ({ archive, archiveId }: { archive: Archive; archive
<Tag isDeleteable={false} key={tag.content} tag={tag} />
))}
</div>
<div className={styles.intro}>
<FontAwesomeIcon icon={faFeather} />
{archive.introduction}
</div>
</div>
);
};
13 changes: 13 additions & 0 deletions src/widgets/WriteArchive/WriteStep.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,19 @@ export const WriteStep = ({
/>
</div>
</div>
<div className={styles.inputContainer}>
<label>한 줄 소개</label>
<div className={styles.inputBox}>
<input
onChange={e => {
updateArchiveData('introduction', e.target.value);
}}
placeholder='스토리를 나타낼 간단한 소개 글을 적어주세요'
type='text'
value={archiveData.introduction}
/>
</div>
</div>
<MarkdownEditor />
<div className={styles.inputContainer}>
<label>태그</label>
Expand Down

1 comment on commit e369392

@github-actions
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡ Lighthouse report for http://localhost:3000/

Category Score
🔴 Performance 23
🟢 Accessibility 95
🟢 Best Practices 100
🟠 SEO 83

Detailed Metrics

Metric Value
🔴 First Contentful Paint 44.0 s
🔴 Largest Contentful Paint 73.1 s
🔴 Total Blocking Time 1,050 ms
🟢 Cumulative Layout Shift 0
🔴 Speed Index 57.8 s

Please sign in to comment.