Skip to content

Commit

Permalink
HOTFIX: 빌드 오류 해결 위한 미사용 코드 제거
Browse files Browse the repository at this point in the history
  • Loading branch information
seoyoung-min authored Feb 4, 2024
1 parent 4c369e4 commit 0b92fab
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 20 deletions.
4 changes: 2 additions & 2 deletions src/app/create/_components/CreateItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export default function CreateItem({ onBackClick, onSubmitClick }: CreateItemPro

return (
<div>
<Header isNextActive={isValid} onClickNext={onSubmitClick} />

<Header onBackClick={onBackClick} isSubmitActive={isValid} onSubmitClick={onSubmitClick} />
<div className={styles.article}>
<h3 className={styles.label}>
아이템 추가 <span className={styles.required}>*</span>
</h3>

<p className={styles.description}>
최소 3개, 최대 10개까지 아이템을 추가할 수 있어요. <br />
아이템의 순서대로 순위가 정해져요.
Expand Down
4 changes: 2 additions & 2 deletions src/app/create/_components/CreateList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import { UserProfileType } from '@/lib/types/userProfileType';
import { getCategories } from '@/app/_api/category/getCategories';
import { getUsers } from '@/app/_api/user/getUsers';
import { listDescriptionRules, listLabelRules, listTitleRules } from '@/lib/constants/formInputValidationRules';
import { listDescription } from '@/app/[userNickname]/[listId]/_components/ListDetailOuter/ListInformation.css';
// import { listDescription } from '@/app/[userNickname]/[listId]/_components/ListDetailOuter/ListInformation.css';

interface CreateListProps {
onNextClick: () => void;
Expand Down Expand Up @@ -71,7 +71,7 @@ function CreateList({ onNextClick }: CreateListProps) {
}
};
handleQueryParams();
}, []);
}, ['isTemplateCreation', 'searchParams', 'setValue']);

return (
<div>
Expand Down
17 changes: 10 additions & 7 deletions src/app/create/_components/item/Header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,22 @@ import BackIcon from '/public/icons/back.svg';
import * as styles from './Header.css';

interface HeaderProps {
isNextActive: boolean;
onClickNext: () => void;
onBackClick: () => void;
isSubmitActive: boolean;
onSubmitClick: () => void;
}

function Header({ isNextActive, onClickNext }: HeaderProps) {
function Header({ onBackClick, isSubmitActive, onSubmitClick }: HeaderProps) {
return (
<div className={styles.header}>
<BackIcon alt="뒤로가기 버튼" />
<button onClick={onBackClick}>
<BackIcon alt="뒤로가기 버튼" />
</button>
<h1 className={styles.headerTitle}>리스트 생성</h1>
<button
className={isNextActive ? styles.headerNextButtonActive : styles.headerNextButton}
disabled={!isNextActive}
onClick={onClickNext}
className={isSubmitActive ? styles.headerNextButtonActive : styles.headerNextButton}
disabled={!isSubmitActive}
onClick={onSubmitClick}
>
완료
</button>
Expand Down
14 changes: 6 additions & 8 deletions src/app/create/_components/item/Items.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { ChangeEvent, useState } from 'react';
import { useState } from 'react';
import { useFieldArray, useFormContext, useWatch } from 'react-hook-form';
import { DragDropContext, Draggable, DropResult } from 'react-beautiful-dnd';

Expand All @@ -21,14 +21,13 @@ const ensureHttp = (link: string) => {
};

// 링크 도메인만 추출 (e.g. naver.com)
const urlToDomain = (link: string) => {
const domain = new URL(link).hostname.replace('www.', '');
return domain;
};
// const urlToDomain = (link: string) => {
// const domain = new URL(link).hostname.replace('www.', '');
// return domain;
// };

export default function Items() {
const [currentLink, setCurrentLink] = useState<string>('');

const {
register,
control,
Expand Down Expand Up @@ -86,8 +85,7 @@ export default function Items() {
const titleError = errorMessage('title');
const commentError = errorMessage('comment');
const linkError = errorMessage('link');
const imageError = errorMessage('image');

// const imageError = errorMessage('image');
return (
<Draggable key={item.id} draggableId={item.id} index={index}>
{(provided, snapshot) => (
Expand Down
2 changes: 1 addition & 1 deletion src/app/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ export default function CreatePage() {
});

const handleSubmit = () => {
const { listData, imageData, imageFileList } = formatData();
const { listData } = formatData();
createListMutation.mutate(listData);
};

Expand Down

0 comments on commit 0b92fab

Please sign in to comment.