Skip to content

Commit

Permalink
Fix : details api 500 bad request error 수정 -> hooks/useFetchDetails, …
Browse files Browse the repository at this point in the history
…Chore : root layout.tsx metadata수정, Refactor : assets 폴더 삭제, public 폴더로 대체 + import경로 절대 경로로 수정
  • Loading branch information
yyj0917 committed Nov 16, 2024
1 parent d65d9aa commit 095489c
Show file tree
Hide file tree
Showing 23 changed files with 22 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { useFetchDetails } from "@/hooks/useFetchDetails";
import { useEffect, useState } from "react";
import { usePathname } from "next/navigation";
import RightArrow from '@/assets/svg/RightArrow.svg';
import RightArrow from '@/public/svg/RightArrow.svg';


export default function DetailPage() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"use client"

import { useEffect, useState } from "react";
import { Movie } from "@/types/movie";
import Top10 from "../../../../assets/svg/Top10.svg";
import { useFetchAllMovies } from "@/hooks/useFetchContents";
import { Movie } from "@/types/movie";
import Top10 from "@/public/svg/Top10.svg";
import Link from "next/link";

export default function Header() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { movieCategories } from '../../../../data/categories';
import { movieCategories } from '@/data/categories';
import ContentRow from './ContentRow';
import { useFetchAllMovies } from '@/hooks/useFetchContents';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import Logo from '../../../../assets/svg/home-logo.svg';
import Logo from '@/public/svg/home-logo.svg';

export default function NavBar() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { Movie } from '../../../../types/movie';
import { Movie } from '@/types/movie';
import { TvShow } from '@/types/tvshows';
import { useFetchAllMovies, useFetchAllTvShows } from '@/hooks/useFetchContents';
import Link from 'next/link';
Expand Down
6 changes: 3 additions & 3 deletions netflix-assignment/src/app/(route)/home/_components/Span.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import Plus from '../../../../assets/svg/Plus.svg';
import Info from '../../../../assets/svg/Info.svg';
import RightArrow from '../../../../assets/svg/RightArrow.svg';
import Plus from '@/public/svg/Plus.svg';
import Info from '@/public//svg/Info.svg';
import RightArrow from '@/public//svg/RightArrow.svg';

export default function Span() {
return (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use client"

import { tvCategories } from '../../../../data/categories';
import { tvCategories } from '@/data/categories';
import ContentRow from './ContentRow';
import { useFetchAllTvShows } from '@/hooks/useFetchContents';

Expand Down
Binary file modified netflix-assignment/src/app/favicon.ico
Binary file not shown.
7 changes: 5 additions & 2 deletions netflix-assignment/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,11 @@ import "./globals.css";


export const metadata: Metadata = {
title: "Create Next App",
description: "Generated by create next app",
title: "Netflix Assignment",
description: "Netflix Assignment",
icons: {
icon: '/favicon.ico',
}
};

export default function RootLayout({
Expand Down
2 changes: 1 addition & 1 deletion netflix-assignment/src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"use client"

import "./style.css";
import LogoSVG from '../assets/svg/logos_netflix.svg';
import LogoSVG from '@/public/svg/logos_netflix.svg';
import { useRouter } from 'next/navigation';
import { useEffect } from "react";

Expand Down
10 changes: 5 additions & 5 deletions netflix-assignment/src/components/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import { useEffect, useState } from 'react';
import { usePathname, useRouter } from 'next/navigation';
import Home from '../assets/svg/Home.svg';
import Search from '../assets/svg/Search.svg';
import ComingSoon from '../assets/svg/ComingSoon.svg';
import Downloads from '../assets/svg/Downloads.svg';
import More from '../assets/svg/More.svg';
import Home from '@/public/svg/Home.svg';
import Search from '@/public/svg/Search.svg';
import ComingSoon from '@/public/svg/ComingSoon.svg';
import Downloads from '@/public/svg/Downloads.svg';
import More from '@/public/svg/More.svg';

type NavItem = {
id: number;
Expand Down
1 change: 1 addition & 0 deletions netflix-assignment/src/hooks/useFetchDetails.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,6 @@ export const useFetchDetails = (type: 'movie' | 'tv' | null, id: string | null)
queryKey: ['details', type, id],
queryFn: () => fetchDetails(type, id),
staleTime: 1000 * 60 * 60,
enabled: !!type && !!id, // type과 id가 존재할 때만 실행
});
};
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes
File renamed without changes

0 comments on commit 095489c

Please sign in to comment.