Skip to content

Commit

Permalink
Style: eslint no-unused-vars 코드 제거 및 react-hooks/exhaustive-deps 의존성 …
Browse files Browse the repository at this point in the history
…배열 추가
  • Loading branch information
ParkSohyunee committed Dec 17, 2024
1 parent 85c9b75 commit 78f885a
Show file tree
Hide file tree
Showing 20 changed files with 17 additions and 42 deletions.
2 changes: 1 addition & 1 deletion src/app/collection/[folderId]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ export default function CollectionDetailPage({ params }: ParamType) {
if (listData) {
setValue(listData.pages[0].folderName);
}
}, []);
}, [listData]);

return (
<section>
Expand Down
2 changes: 0 additions & 2 deletions src/app/intro/_components/LabelsAnimation.css.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { style, keyframes } from '@vanilla-extract/css';
import { vars } from '@/styles/__theme.css';
import * as fonts from '@/styles/__font.css';

export const wrapper = style({
height: '300px',
Expand Down
2 changes: 1 addition & 1 deletion src/app/intro/_components/SearchBar.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { style, keyframes } from '@vanilla-extract/css';
import { style } from '@vanilla-extract/css';
import { vars } from '@/styles/__theme.css';
import * as fonts from '@/styles/__font.css';

Expand Down
1 change: 0 additions & 1 deletion src/app/intro/_components/Section3.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use client';
import Image from 'next/image';

import MotionWrapper from './MotionWrapper';
import * as styles from './Section3.css';
Expand Down
1 change: 0 additions & 1 deletion src/app/intro/_components/Section4.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { style, keyframes } from '@vanilla-extract/css';
import { vars } from '@/styles/__theme.css';
import * as fonts from '@/styles/__font.css';

export const background = style({
Expand Down
2 changes: 1 addition & 1 deletion src/app/intro/_components/Section5.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { style, keyframes } from '@vanilla-extract/css';
import { style } from '@vanilla-extract/css';
import { vars } from '@/styles/__theme.css';
import * as fonts from '@/styles/__font.css';

Expand Down
2 changes: 1 addition & 1 deletion src/app/intro/_components/Section7.css.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { style, createVar } from '@vanilla-extract/css';
import { style } from '@vanilla-extract/css';
import { vars } from '@/styles/__theme.css';
import * as fonts from '@/styles/__font.css';

Expand Down
2 changes: 1 addition & 1 deletion src/app/list/[listId]/edit/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export default function EditPage() {
}

methods.trigger(['title']);
}, [listDetailData, categories, methods]);
}, [listDetailData, categories, methods, user.id]);

/** Request 보내기 */
//--- 포맷 맞추기
Expand Down
3 changes: 1 addition & 2 deletions src/app/list/create/_components/StepOne.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use client';

import { useEffect, useState } from 'react';
import { useEffect } from 'react';
import { useRouter } from 'next/navigation';
import { useFormContext, useWatch } from 'react-hook-form';
import { useQuery } from '@tanstack/react-query';
Expand All @@ -11,7 +11,6 @@ import { listCategoryRules, listDescriptionRules, listTitleRules } from '@/lib/c
import { useLanguage } from '@/store/useLanguage';
import Header from '@/components/Header/Header';

import { getListDetail } from '@/app/_api/list/getLists'; //TODO: 확인하기
import getCategories from '@/app/_api/category/getCategories';

import { listError, listLocale } from '@/app/list/create/locale';
Expand Down
4 changes: 2 additions & 2 deletions src/app/list/create/_components/StepThree.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export default function StepThree({ onBeforeClick, onNextClick, type, isSubmitti
register: labelRegister,
setError,
clearErrors,
formState: { errors: labelError, isValid: isLabelValid },
formState: { errors: labelError },
} = useForm<{ newLabel: string }>({
mode: 'onChange',
defaultValues: {
Expand Down Expand Up @@ -244,7 +244,7 @@ export default function StepThree({ onBeforeClick, onNextClick, type, isSubmitti
className={styles.radioInput}
type="radio"
checked={!isPublic}
onChange={(e) => {
onChange={() => {
setIsPublic(false);
setValue('isPublic', false);
}}
Expand Down
2 changes: 1 addition & 1 deletion src/app/list/create/_components/StepTwo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import ItemAccordion from './ItemAccordion';
import AddIcon from '/public/icons/add.svg';

import * as styles from './Step.css';
import { ItemType, ListCreateType } from '@/lib/types/listType';
import { ItemType } from '@/lib/types/listType';
import toasting from '@/lib/utils/toasting';
import toastMessage from '@/lib/constants/toastMessage';
import NoDataComponent from '@/components/NoData/NoDataComponent';
Expand Down
2 changes: 1 addition & 1 deletion src/app/list/create/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ export default function CreatePage() {
//데이터 쪼개기
const listData: ListCreateType = {
...originData,
items: originData.items.map(({ imageUrl, ...rest }) => {
items: originData.items.map(({ ...rest }) => {
return {
...rest,
imageUrl: '',
Expand Down
8 changes: 4 additions & 4 deletions src/app/start-listy/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
*/

import { useQuery } from '@tanstack/react-query';
import { useEffect, useState } from 'react';
import { useCallback, useEffect, useState } from 'react';

import { useUser } from '@/store/useUser';
import getUserOne from '../_api/user/getUserOne';
Expand Down Expand Up @@ -36,7 +36,7 @@ export default function StartListyPage() {
setStepIndex((prev) => prev + 1);
};

const handleBackControl = () => {
const handleBackControl = useCallback(() => {
/**
TODO
* 뒤로가기 클릭시, [온보딩을 종료할까요?] 모달
Expand All @@ -47,15 +47,15 @@ export default function StartListyPage() {

alert(startListyLocale[language].endOnboardingMessage);
// 다른 페이지로 이동
};
}, [language]);

useEffect(() => {
history.pushState('onboard', '', '/intro'); // 브라우저 기본 동작으로 온보딩페이지에 접근하지 못하도록 설정
window.addEventListener('popstate', handleBackControl); // 온보딩 페이지에서 브라우저 이동 시, 수행할 로직
return () => {
window.removeEventListener('popstate', handleBackControl);
};
}, []);
}, [handleBackControl]);

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/app/topics/_components/BottomSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ function BottomSheet({ onClose }: BottomSheetProps) {
setIsAnonymous(false);
openModal();
},
onError: (error) => {
onError: () => {
setErrorMessage('요청 중 오류가 발생했습니다. 다시 시도해 주세요. :(');
},
});
Expand Down
14 changes: 0 additions & 14 deletions src/app/user/[userId]/(follow)/_components/UserList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,9 @@ import { QUERY_KEYS } from '@/lib/constants/queryKeys';

import * as styles from './UserList.css';
import NoDataComponent from '@/components/NoData/NoDataComponent';
import getFollowerList from '@/app/_api/follow/getFollowerList';
import { userLocale } from '@/app/user/locale';
import { useLanguage } from '@/store/useLanguage';

// const BUTTON_MESSAGE = {
// ko: {
// delete: '삭제',
// },
// };
//
// const EMPTY_MESSAGE = {
// ko: {
// follower: '아직은 팔로워가 없어요',
// following: '아직 팔로우한 사람이 없어요',
// },
// };

function DeleteFollowerButton({ userId }: { userId: number }) {
const { language } = useLanguage();
const { user } = useUser();
Expand Down
1 change: 0 additions & 1 deletion src/components/BottomSheet/ver3.0/BottomSheetContent.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import { ReactNode } from 'react';
import * as styles from './BottomSheet.css';

interface ContentsType {
Expand Down
2 changes: 1 addition & 1 deletion src/components/SegmentedControl/SegmentedControl.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import * as styles from './SegmentedCotrol.css';
interface SegmentedControlProps {
options: string[];
selected: string;
handleSelect: (option: any) => void;
handleSelect: (option: string) => void;
}

export default function SegmentedControl({ options, selected, handleSelect }: SegmentedControlProps) {
Expand Down
1 change: 0 additions & 1 deletion src/components/SegmentedControl/SegmentedCotrol.css.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { style } from '@vanilla-extract/css';
import * as fonts from '@/styles/font.css';
import { vars } from '@/styles/theme.css';

export const track = style({
Expand Down
4 changes: 0 additions & 4 deletions src/components/SimpleList/SimpleList.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
import Image from 'next/image';

import { ListItemType } from '@/lib/types/exploreType';
import * as styles from './SimpleList.css';
import HeartIcon from '/public/icons/ver3/blue_heart.svg';
import { commonLocale } from '@/components/locale';
import { useLanguage } from '@/store/useLanguage';

interface SimpleListProps {
items: ListItemType[];
Expand Down
2 changes: 1 addition & 1 deletion src/lib/utils/saveImageFromHtml.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ interface SaveImageFromHtmlProps {
element: HTMLElement;
}

async function saveImageFromHtml({ filename, element }: SaveImageFromHtmlProps) {
async function saveImageFromHtml({ filename }: SaveImageFromHtmlProps) {
const saveElement: HTMLElement | null = document.querySelector('#rankList');
if (!saveElement) {
console.error('리스트를 찾을 수 없습니다.');
Expand Down

0 comments on commit 78f885a

Please sign in to comment.