From 505ff4d839e95282514500e76b4a9a0b2f94d1d6 Mon Sep 17 00:00:00 2001 From: zyachel Date: Sat, 28 Jan 2023 22:09:27 +0530 Subject: [PATCH] refactor: replace relative paths with absolute ones in import statements --- src/components/buttons/ThemeToggler.tsx | 5 +-- src/components/error/ErrorInfo.tsx | 7 ++-- src/components/find/Company.tsx | 4 +- src/components/find/Keyword.tsx | 5 +-- src/components/find/Person.tsx | 10 ++--- src/components/find/Title.tsx | 15 ++++--- src/components/find/index.tsx | 17 ++++---- src/components/forms/find/index.tsx | 45 ++++++++++---------- src/components/loaders/ProgressBar.tsx | 2 +- src/components/title/Basic.tsx | 7 ++-- src/components/title/Cast.tsx | 7 ++-- src/components/title/DidYouKnow.tsx | 5 +-- src/components/title/Info.tsx | 7 ++-- src/components/title/Media.tsx | 7 ++-- src/components/title/MoreLikeThis.tsx | 6 +-- src/components/title/Reviews.tsx | 6 +-- src/context/theme-context.tsx | 2 +- src/interfaces/misc/rawFind.ts | 5 ++- src/interfaces/shared/search.ts | 4 +- src/interfaces/shared/title.ts | 4 +- src/layouts/Footer.tsx | 4 +- src/layouts/Header.tsx | 5 +-- src/pages/404.tsx | 2 +- src/pages/500.tsx | 2 +- src/pages/_app.tsx | 13 +++--- src/pages/about/index.tsx | 8 ++-- src/pages/api/media_proxy.ts | 4 +- src/pages/contact/index.tsx | 7 ++-- src/pages/find/index.tsx | 23 +++++------ src/pages/privacy/index.tsx | 8 ++-- src/pages/title/[titleId]/index.tsx | 55 ++++++++++--------------- src/utils/cleaners/find.ts | 2 +- src/utils/cleaners/title.ts | 4 +- src/utils/fetchers/basicSearch.ts | 10 ++--- src/utils/fetchers/title.ts | 11 ++--- src/utils/helpers.ts | 2 +- tsconfig.json | 6 ++- 37 files changed, 153 insertions(+), 183 deletions(-) diff --git a/src/components/buttons/ThemeToggler.tsx b/src/components/buttons/ThemeToggler.tsx index bd9614b..8488c73 100644 --- a/src/components/buttons/ThemeToggler.tsx +++ b/src/components/buttons/ThemeToggler.tsx @@ -1,7 +1,6 @@ import { useContext } from 'react'; -import { themeContext } from '../../context/theme-context'; - -import styles from '../../styles/modules/components/buttons/themeToggler.module.scss'; +import { themeContext } from 'src/context/theme-context'; +import styles from 'src/styles/modules/components/buttons/themeToggler.module.scss'; type Props = { className: string; diff --git a/src/components/error/ErrorInfo.tsx b/src/components/error/ErrorInfo.tsx index 08f17b4..58621f3 100644 --- a/src/components/error/ErrorInfo.tsx +++ b/src/components/error/ErrorInfo.tsx @@ -1,9 +1,8 @@ import { ReactNode } from 'react'; import Link from 'next/link'; -import Layout from '../../layouts/Layout'; -import Meta from '../meta/Meta'; - -import styles from '../../styles/modules/components/error/error-info.module.scss'; +import Layout from 'src/layouts/Layout'; +import Meta from 'src/components/meta/Meta'; +import styles from 'src/styles/modules/components/error/error-info.module.scss'; // for details regarding the svg, go to sadgnu.svg file // description copied verbatim from https://www.gnu.org/graphics/sventsitsky-sadgnu.html diff --git a/src/components/find/Company.tsx b/src/components/find/Company.tsx index 4f86e7f..969bbde 100644 --- a/src/components/find/Company.tsx +++ b/src/components/find/Company.tsx @@ -1,7 +1,7 @@ -import { Companies } from '../../interfaces/shared/search'; +import { Companies } from 'src/interfaces/shared/search'; import Link from 'next/link'; -import styles from '../../styles/modules/components/find/company.module.scss'; +import styles from 'src/styles/modules/components/find/company.module.scss'; type Props = { company: Companies[0]; diff --git a/src/components/find/Keyword.tsx b/src/components/find/Keyword.tsx index e9bfac6..6ca0856 100644 --- a/src/components/find/Keyword.tsx +++ b/src/components/find/Keyword.tsx @@ -1,7 +1,6 @@ -import { Keywords } from '../../interfaces/shared/search'; import Link from 'next/link'; - -import styles from '../../styles/modules/components/find/keyword.module.scss'; +import { Keywords } from 'src/interfaces/shared/search'; +import styles from 'src/styles/modules/components/find/keyword.module.scss'; type Props = { keyword: Keywords[0]; diff --git a/src/components/find/Person.tsx b/src/components/find/Person.tsx index eb8993b..ee86037 100644 --- a/src/components/find/Person.tsx +++ b/src/components/find/Person.tsx @@ -1,8 +1,8 @@ -import { People } from '../../interfaces/shared/search'; import Image from 'next/future/image'; import Link from 'next/link'; -import { modifyIMDbImg } from '../../utils/helpers'; -import styles from '../../styles/modules/components/find/person.module.scss'; +import { People } from 'src/interfaces/shared/search'; +import { modifyIMDbImg } from 'src/utils/helpers'; +import styles from 'src/styles/modules/components/find/person.module.scss'; type Props = { person: People[0]; @@ -21,7 +21,7 @@ const Person = ({ person }: Props) => { /> ) : ( - + )} @@ -32,7 +32,7 @@ const Person = ({ person }: Props) => { {person.aka &&

{person.aka}

} {person.jobCateogry &&

{person.jobCateogry}

} {(person.knownForTitle || person.knownInYear) && ( -