Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions docs/slide-data-flow-legacy.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,8 @@ classDiagram
+string content
+string script
+OpinionItem[] opinions
+HistoryItem[] history
+EmojiReaction[] emojiReactions
+History[] history
+Reaction[] emojiReactions
}

class OpinionItem {
Expand All @@ -192,20 +192,20 @@ classDiagram
+number parentId
}

class HistoryItem {
class History {
+string id
+string timestamp
+string content
}

class EmojiReaction {
class Reaction {
+string emoji
+number count
}

Slide "1" --> "*" OpinionItem
Slide "1" --> "*" HistoryItem
Slide "1" --> "*" EmojiReaction
Slide "1" --> "*" History
Slide "1" --> "*" Reaction
```

## 7. 컴포넌트별 Context 사용
Expand Down
12 changes: 6 additions & 6 deletions docs/slide-data-flow.md
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ classDiagram
+string content
+string script
+OpinionItem[] opinions
+HistoryItem[] history
+EmojiReaction[] emojiReactions
+History[] history
+Reaction[] emojiReactions
}

class OpinionItem {
Expand All @@ -237,21 +237,21 @@ classDiagram
+number parentId
}

class HistoryItem {
class History {
+string id
+string timestamp
+string content
}

class EmojiReaction {
class Reaction {
+string emoji
+number count
}

SlideStore --> Slide
Slide --> "*" OpinionItem
Slide --> "*" HistoryItem
Slide --> "*" EmojiReaction
Slide --> "*" History
Slide --> "*" Reaction
```

## 7. Context vs Zustand 비교
Expand Down
Binary file added public/thumbnails/p1.pdf
Binary file not shown.
Binary file added public/thumbnails/p1/0.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/1.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/10.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/11.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/12.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/13.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/14.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/15.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/16.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/17.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/18.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/19.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/2.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/20.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/21.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/22.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/23.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/24.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/25.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/26.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/27.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/28.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/29.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/3.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/30.webp
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/thumbnails/p1/31.webp
Binary file added public/thumbnails/p1/32.webp
Binary file added public/thumbnails/p1/33.webp
Binary file added public/thumbnails/p1/34.webp
Binary file added public/thumbnails/p1/35.webp
Binary file added public/thumbnails/p1/36.webp
Binary file added public/thumbnails/p1/37.webp
Binary file added public/thumbnails/p1/38.webp
Binary file added public/thumbnails/p1/39.webp
Binary file added public/thumbnails/p1/4.webp
Binary file added public/thumbnails/p1/40.webp
Binary file added public/thumbnails/p1/41.webp
Binary file added public/thumbnails/p1/42.webp
Binary file added public/thumbnails/p1/43.webp
Binary file added public/thumbnails/p1/44.webp
Binary file added public/thumbnails/p1/45.webp
Binary file added public/thumbnails/p1/46.webp
Binary file added public/thumbnails/p1/47.webp
Binary file added public/thumbnails/p1/48.webp
Binary file added public/thumbnails/p1/49.webp
Binary file added public/thumbnails/p1/5.webp
Binary file added public/thumbnails/p1/50.webp
Binary file added public/thumbnails/p1/51.webp
Binary file added public/thumbnails/p1/52.webp
Binary file added public/thumbnails/p1/53.webp
Binary file added public/thumbnails/p1/54.webp
Binary file added public/thumbnails/p1/55.webp
Binary file added public/thumbnails/p1/56.webp
Binary file added public/thumbnails/p1/57.webp
Binary file added public/thumbnails/p1/58.webp
Binary file added public/thumbnails/p1/59.webp
Binary file added public/thumbnails/p1/6.webp
Binary file added public/thumbnails/p1/60.webp
Binary file added public/thumbnails/p1/61.webp
Binary file added public/thumbnails/p1/62.webp
Binary file added public/thumbnails/p1/63.webp
Binary file added public/thumbnails/p1/64.webp
Binary file added public/thumbnails/p1/65.webp
Binary file added public/thumbnails/p1/66.webp
Binary file added public/thumbnails/p1/67.webp
Binary file added public/thumbnails/p1/68.webp
Binary file added public/thumbnails/p1/69.webp
Binary file added public/thumbnails/p1/7.webp
Binary file added public/thumbnails/p1/8.webp
Binary file added public/thumbnails/p1/9.webp
Binary file added public/thumbnails/p2.pdf
Binary file not shown.
Binary file added public/thumbnails/p2/0.webp
Binary file added public/thumbnails/p2/1.webp
Binary file added public/thumbnails/p2/10.webp
Binary file added public/thumbnails/p2/11.webp
Binary file added public/thumbnails/p2/12.webp
Binary file added public/thumbnails/p2/13.webp
Binary file added public/thumbnails/p2/14.webp
Binary file added public/thumbnails/p2/15.webp
Binary file added public/thumbnails/p2/16.webp
Binary file added public/thumbnails/p2/17.webp
Binary file added public/thumbnails/p2/18.webp
Binary file added public/thumbnails/p2/19.webp
Binary file added public/thumbnails/p2/2.webp
Binary file added public/thumbnails/p2/20.webp
Binary file added public/thumbnails/p2/21.webp
Binary file added public/thumbnails/p2/22.webp
Binary file added public/thumbnails/p2/23.webp
Binary file added public/thumbnails/p2/24.webp
Binary file added public/thumbnails/p2/25.webp
Binary file added public/thumbnails/p2/26.webp
Binary file added public/thumbnails/p2/27.webp
Binary file added public/thumbnails/p2/28.webp
Binary file added public/thumbnails/p2/29.webp
Binary file added public/thumbnails/p2/3.webp
Binary file added public/thumbnails/p2/30.webp
Binary file added public/thumbnails/p2/31.webp
Binary file added public/thumbnails/p2/32.webp
Binary file added public/thumbnails/p2/33.webp
Binary file added public/thumbnails/p2/34.webp
Binary file added public/thumbnails/p2/35.webp
Binary file added public/thumbnails/p2/36.webp
Binary file added public/thumbnails/p2/37.webp
Binary file added public/thumbnails/p2/38.webp
Binary file added public/thumbnails/p2/39.webp
Binary file added public/thumbnails/p2/4.webp
Binary file added public/thumbnails/p2/40.webp
Binary file added public/thumbnails/p2/41.webp
Binary file added public/thumbnails/p2/42.webp
Binary file added public/thumbnails/p2/43.webp
Binary file added public/thumbnails/p2/44.webp
Binary file added public/thumbnails/p2/45.webp
Binary file added public/thumbnails/p2/46.webp
Binary file added public/thumbnails/p2/47.webp
Binary file added public/thumbnails/p2/48.webp
Binary file added public/thumbnails/p2/49.webp
Binary file added public/thumbnails/p2/5.webp
Binary file added public/thumbnails/p2/50.webp
Binary file added public/thumbnails/p2/51.webp
Binary file added public/thumbnails/p2/52.webp
Binary file added public/thumbnails/p2/53.webp
Binary file added public/thumbnails/p2/54.webp
Binary file added public/thumbnails/p2/55.webp
Binary file added public/thumbnails/p2/56.webp
Binary file added public/thumbnails/p2/57.webp
Binary file added public/thumbnails/p2/58.webp
Binary file added public/thumbnails/p2/6.webp
Binary file added public/thumbnails/p2/7.webp
Binary file added public/thumbnails/p2/8.webp
Binary file added public/thumbnails/p2/9.webp
Binary file added public/thumbnails/p3.pdf
Binary file not shown.
Binary file added public/thumbnails/p3/0.webp
Binary file added public/thumbnails/p3/1.webp
Binary file added public/thumbnails/p3/10.webp
Binary file added public/thumbnails/p3/11.webp
Binary file added public/thumbnails/p3/12.webp
Binary file added public/thumbnails/p3/13.webp
Binary file added public/thumbnails/p3/14.webp
Binary file added public/thumbnails/p3/15.webp
Binary file added public/thumbnails/p3/16.webp
Binary file added public/thumbnails/p3/2.webp
Binary file added public/thumbnails/p3/3.webp
Binary file added public/thumbnails/p3/4.webp
Binary file added public/thumbnails/p3/5.webp
Binary file added public/thumbnails/p3/6.webp
Binary file added public/thumbnails/p3/7.webp
Binary file added public/thumbnails/p3/8.webp
Binary file added public/thumbnails/p3/9.webp
Binary file added public/thumbnails/p4.pdf
Binary file not shown.
Binary file added public/thumbnails/p4/0.webp
Binary file added public/thumbnails/p4/1.webp
Binary file added public/thumbnails/p4/10.webp
Binary file added public/thumbnails/p4/11.webp
Binary file added public/thumbnails/p4/12.webp
Binary file added public/thumbnails/p4/13.webp
Binary file added public/thumbnails/p4/14.webp
Binary file added public/thumbnails/p4/15.webp
Binary file added public/thumbnails/p4/16.webp
Binary file added public/thumbnails/p4/17.webp
Binary file added public/thumbnails/p4/18.webp
Binary file added public/thumbnails/p4/19.webp
Binary file added public/thumbnails/p4/2.webp
Binary file added public/thumbnails/p4/20.webp
Binary file added public/thumbnails/p4/21.webp
Binary file added public/thumbnails/p4/22.webp
Binary file added public/thumbnails/p4/23.webp
Binary file added public/thumbnails/p4/24.webp
Binary file added public/thumbnails/p4/25.webp
Binary file added public/thumbnails/p4/26.webp
Binary file added public/thumbnails/p4/27.webp
Binary file added public/thumbnails/p4/3.webp
Binary file added public/thumbnails/p4/4.webp
Binary file added public/thumbnails/p4/5.webp
Binary file added public/thumbnails/p4/6.webp
Binary file added public/thumbnails/p4/7.webp
Binary file added public/thumbnails/p4/8.webp
Binary file added public/thumbnails/p4/9.webp
Binary file removed public/thumbnails/slide-0.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-1.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-2.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-3.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-4.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-5.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-6.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-7.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-8.webp
Diff not rendered.
Binary file removed public/thumbnails/slide-9.webp
Diff not rendered.
9 changes: 3 additions & 6 deletions src/api/endpoints/opinions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* @description 의견(댓글) 관련 API 엔드포인트
*/
import { apiClient } from '@/api';
import type { CommentItem } from '@/types/comment';
import type { Comment } from '@/types/comment';

/**
* 의견 생성 요청 타입
Expand All @@ -21,11 +21,8 @@ export interface CreateOpinionRequest {
* @param data - 의견 데이터
* @returns 생성된 의견
*/
export async function createOpinion(
slideId: string,
data: CreateOpinionRequest,
): Promise<CommentItem> {
const response = await apiClient.post<CommentItem>(`/slides/${slideId}/opinions`, data);
export async function createOpinion(slideId: string, data: CreateOpinionRequest): Promise<Comment> {
const response = await apiClient.post<Comment>(`/slides/${slideId}/opinions`, data);
return response.data;
}

Expand Down
7 changes: 2 additions & 5 deletions src/api/endpoints/reactions.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
import { apiClient } from '@/api';
import type { EmojiReaction, ReactionType } from '@/types/script';
import type { Reaction, ReactionType } from '@/types/script';

export interface ToggleReactionRequest {
type: ReactionType;
}

export const toggleReaction = async (slideId: string, data: ToggleReactionRequest) => {
const { data: response } = await apiClient.post<EmojiReaction[]>(
`/slides/${slideId}/reactions`,
data,
);
const { data: response } = await apiClient.post<Reaction[]>(`/slides/${slideId}/reactions`, data);
return response;
};
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/**
* @file CommentItem.tsx
* @file Comment.tsx
* @description 댓글 항목 공통 컴포넌트
*
* 슬라이드 화면(CommentPopover)과 피드백 화면(CommentList) 모두에서 사용됩니다.
Expand All @@ -13,14 +13,14 @@ import FileIcon from '@/assets/icons/icon-document.svg?react';
import RemoveIcon from '@/assets/icons/icon-remove.svg?react';
import ReplyIcon from '@/assets/icons/icon-reply.svg?react';
import { MOCK_USERS } from '@/mocks/users';
import type { CommentItem as CommentItemType } from '@/types/comment';
import type { Comment as CommentType } from '@/types/comment';
import { formatRelativeTime } from '@/utils/format';

import CommentInput from './CommentInput';

interface CommentItemProps {
interface CommentProps {
/** 댓글 데이터 */
comment: CommentItemType;
comment: CommentType;
/** 답글 입력창 활성화 여부 */
isActive: boolean;
/** 답글 입력값 */
Expand Down Expand Up @@ -57,7 +57,7 @@ interface CommentItemProps {
* 댓글 내용, 작성자 정보, 답글 버튼, 삭제 버튼을 표시합니다.
* 대댓글은 재귀적으로 렌더링됩니다.
*/
function CommentItem({
function Comment({
comment,
isActive,
replyText,
Expand All @@ -73,7 +73,7 @@ function CommentItem({
setReplyingToId,
onReplySubmit,
onToggleReplyById,
}: CommentItemProps) {
}: CommentProps) {
const user = MOCK_USERS.find((u) => u.id === comment.authorId);
const authorName = user?.name ?? '알 수 없음';
const authorProfileImage = user?.profileImage;
Expand Down Expand Up @@ -199,7 +199,7 @@ function CommentItem({
{comment.replies && comment.replies.length > 0 && (
<div className="pl-8">
{comment.replies.map((reply) => (
<CommentItem
<Comment
key={reply.id}
comment={reply}
isActive={replyingToId === reply.id}
Expand All @@ -224,4 +224,4 @@ function CommentItem({
);
}

export default React.memo(CommentItem);
export default React.memo(Comment);
2 changes: 1 addition & 1 deletion src/components/comment/CommentInput.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* @file CommentInput.tsx
* @description 댓글/답글 입력 공통 컴포넌트
*
* FeedbackSlidePage, CommentItem 등에서 재사용됩니다.
* FeedbackSlidePage, Comment 등에서 재사용됩니다.
* textarea 높이 자동 조절, Enter 키 제출을 지원합니다.
*/
import { useCallback, useEffect, useRef } from 'react';
Expand Down
10 changes: 5 additions & 5 deletions src/components/comment/CommentList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@
* @description 피드백 화면 우측 댓글 리스트
*
* 댓글 리스트 렌더링과 답글 입력 상태를 관리합니다.
* 공통 CommentItem 컴포넌트를 사용합니다.
* 공통 Comment 컴포넌트를 사용합니다.
*/
import { useState } from 'react';

import type { CommentItem as CommentItemType } from '@/types/comment';
import type { Comment as CommentType } from '@/types/comment';

import CommentItem from './CommentItem';
import Comment from './Comment';

interface CommentListProps {
comments: CommentItemType[];
comments: CommentType[];
onAddReply: (targetId: string, content: string) => void;
onGoToSlideRef: (ref: string) => void;
onDeleteComment?: (commentId: string) => void;
Expand Down Expand Up @@ -48,7 +48,7 @@ export default function CommentList({
return (
<div className="mt-2 flex-1 space-y-2 overflow-y-auto">
{comments.map((comment) => (
<CommentItem
<Comment
key={comment.id}
comment={comment}
isActive={replyingToId === comment.id}
Expand Down
4 changes: 2 additions & 2 deletions src/components/comment/CommentPopover.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ import clsx from 'clsx';
import { Popover } from '@/components/common';
import { useSlideActions, useSlideOpinions } from '@/hooks';

import CommentItem from './CommentItem';
import Comment from './Comment';

export default function CommentPopover() {
const opinions = useSlideOpinions();
Expand Down Expand Up @@ -86,7 +86,7 @@ export default function CommentPopover() {
{/* 의견 목록 */}
<div className="h-80 overflow-y-auto">
{opinions.map((opinion) => (
<CommentItem
<Comment
key={opinion.id}
comment={opinion}
isActive={activeReplyId === opinion.id}
Expand Down
2 changes: 1 addition & 1 deletion src/components/comment/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as CommentInput } from './CommentInput';
export { default as CommentItem } from './CommentItem';
export { default as Comment } from './Comment';
export { default as CommentList } from './CommentList';
export { default as CommentPopover } from './CommentPopover';
8 changes: 6 additions & 2 deletions src/components/common/Dropdown.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -230,8 +230,12 @@ export function Dropdown({
'text-error': item.variant === 'danger' && !item.selected,
'text-gray-800': item.variant !== 'danger' && !item.selected,
'bg-gray-100': !item.disabled && isFocused && !item.selected,
'bg-main-variant1 text-white': item.selected,
'active:bg-main-variant1 active:text-white': !item.disabled && !item.selected,
'bg-main-variant1 text-white': item.selected && item.variant !== 'danger',
'bg-error text-white': item.selected && item.variant === 'danger',
'active:bg-main-variant1 active:text-white':
!item.disabled && !item.selected && item.variant !== 'danger',
'active:bg-error active:text-white':
!item.disabled && !item.selected && item.variant === 'danger',
},
)}
>
Expand Down
10 changes: 9 additions & 1 deletion src/components/common/FileDropzone.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,18 @@
import { useRef, useState } from 'react';

import UploadIcon from '@/assets/icons/icon-upload.svg?react';
import type { FileDropProps } from '@/types/uploadFile';
import type { UploadState } from '@/types/uploadFile';

import ProgressBar from './ProgressBar';

interface FileDropProps {
onFilesSelected: (files: File[]) => void;
accept?: string;
disabled?: boolean;
uploadState?: UploadState;
progress?: number;
}

export default function FileDropzone({
onFilesSelected,
accept,
Expand Down
22 changes: 10 additions & 12 deletions src/components/common/SlideImage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,17 +18,15 @@ export default function SlideImage({ src, alt }: SlideImageProps) {
const [isLoaded, setIsLoaded] = useState(false);

return (
<>
{!isLoaded && <div className="absolute inset-0 animate-pulse bg-black/10" />}
<img
src={src}
alt={alt}
onLoad={() => setIsLoaded(true)}
className={clsx(
'h-full w-full object-cover transition-opacity duration-300',
isLoaded ? 'opacity-100' : 'opacity-0',
)}
/>
</>
<img
src={src}
alt={alt}
onLoad={() => setIsLoaded(true)}
className={clsx(
'block w-full h-auto transition-opacity duration-300',
!isLoaded && 'animate-pulse bg-gray-200',
isLoaded ? 'opacity-100' : 'opacity-0',
)}
/>
);
}
2 changes: 1 addition & 1 deletion src/components/common/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export { default as CommentItem } from '../comment/CommentItem';
export { default as Comment } from '../comment/Comment';

export { Gnb } from './layout/Gnb';
export { Layout } from './layout/Layout';
Expand Down
5 changes: 3 additions & 2 deletions src/components/feedback/ReactionButtons.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
*
* 피드백 화면 하단에서 슬라이드에 대한 리액션을 표시합니다.
*/
import { type EmojiReaction, REACTION_CONFIG, type ReactionType } from '@/types/script';
import { REACTION_CONFIG } from '@/constants/reaction';
import type { Reaction, ReactionType } from '@/types/script';

interface ReactionButtonsProps {
/** 리액션 목록 (타입, 카운트, 활성화 여부) */
reactions: EmojiReaction[];
reactions: Reaction[];
/** 리액션 토글 핸들러 */
onToggleReaction: (type: ReactionType) => void;
}
Expand Down
14 changes: 12 additions & 2 deletions src/components/home/IntroSection.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,19 @@
import clsx from 'clsx';

import type { IntroSectionProps } from '@/types/home';
import type { UploadState } from '@/types/uploadFile';

import FileDropzone from '../common/FileDropzone';

interface IntroSectionProps {
accept: string;
disabled: boolean;
uploadState: UploadState;
progress: number;
error?: string | null;
onFilesSelected: (files: File[]) => void;
isEmpty: boolean;
}

export default function IntroSection({
accept,
disabled,
Expand All @@ -23,7 +33,7 @@ export default function IntroSection({
{/* 소개글 */}
<div className="mt-10">
<h1 className="text-body-l-bold text-gray-900">발표 연습을 시작하세요.</h1>
<p className="mt-2 text-body-s text-gray-500">
<p className="mt-2 text-body-s text-gray-400">
파일을 업로드해서 바로 연습을 시작해보세요.
</p>
</div>
Expand Down
28 changes: 23 additions & 5 deletions src/components/home/ProjectsSection.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import type { CardItems } from '@/types/project';
import type { SortMode, ViewMode } from '@/types/home';
import type { Project } from '@/types/project';

import ProjectCard from '../projects/ProjectCard';
import { ProjectCardSkeleton } from '../projects/ProjectCardSkeleton';
Expand All @@ -10,10 +11,21 @@ type Props = {
isLoading: boolean;
query: string;
onChangeQuery: (value: string) => void;
projects: CardItems[];
onChangeSort: (value: SortMode) => void;
viewMode: ViewMode;
onChangeViewMode: (value: ViewMode) => void;
projects: Project[];
};

export default function ProjectsSection({ isLoading, query, onChangeQuery, projects }: Props) {
export default function ProjectsSection({
isLoading,
query,
onChangeQuery,
onChangeSort,
viewMode,
onChangeViewMode,
projects,
}: Props) {
const hasProjects = projects.length > 0;

if (!isLoading && !hasProjects) return null;
Expand All @@ -25,8 +37,14 @@ export default function ProjectsSection({ isLoading, query, onChangeQuery, proje
<h2 className="text-body-m-bold">내 발표</h2>
</div>

{/* 검색 */}
<ProjectHeader value={query} onChange={onChangeQuery} />
{/* 검색 및 필터 */}
<ProjectHeader
value={query}
onChange={onChangeQuery}
onChangeSort={onChangeSort}
viewMode={viewMode}
onChangeViewMode={onChangeViewMode}
/>

{/* 프레젠테이션 목록 */}
<div className="mt-6 grid grid-cols-2 gap-4 lg:grid-cols-3">
Expand Down
Loading
Loading