diff --git a/.eslintrc b/.eslintrc deleted file mode 100644 index 913cdba..0000000 --- a/.eslintrc +++ /dev/null @@ -1,3 +0,0 @@ -{ - "extends": ["next", "next/core-web-vitals", "prettier"] -} diff --git a/.prettierrc.js b/.prettierrc.js deleted file mode 100644 index 77ab421..0000000 --- a/.prettierrc.js +++ /dev/null @@ -1,9 +0,0 @@ -module.exports = { - printWidth: 120, - arrowParens: "avoid", - singleQuote: true, - semi: false, - plugins: [ - require('prettier-plugin-tailwindcss') - ] -} diff --git a/package.json b/package.json index 58021b5..16e5e4b 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "build": "next build", "start": "next start", "lint": "next lint", - "format": "prettier 'components/**/*.tsx' 'config/*.js' 'pages/**/*.{ts,tsx}' '{types,utils}/**/*.ts' --write", + "format": "prettier 'src/**/*.{js,ts,jsx,tsx}' --write", "extract": "i18next" }, "dependencies": { @@ -74,5 +74,21 @@ "prettier-plugin-tailwindcss": "^0.2.2", "tailwindcss": "^3.2.4", "typescript": "4.9.4" + }, + "prettier": { + "printWidth": 120, + "arrowParens": "avoid", + "singleQuote": true, + "semi": false, + "plugins": [ + "prettier-plugin-tailwindcss" + ] + }, + "eslintConfig": { + "extends": [ + "next", + "next/core-web-vitals", + "prettier" + ] } } diff --git a/components/Auth.tsx b/src/components/Auth.tsx similarity index 100% rename from components/Auth.tsx rename to src/components/Auth.tsx diff --git a/components/Breadcrumb.tsx b/src/components/Breadcrumb.tsx similarity index 100% rename from components/Breadcrumb.tsx rename to src/components/Breadcrumb.tsx diff --git a/components/CustomEmbedLinkMenu.tsx b/src/components/CustomEmbedLinkMenu.tsx similarity index 100% rename from components/CustomEmbedLinkMenu.tsx rename to src/components/CustomEmbedLinkMenu.tsx diff --git a/components/DownloadBtnGtoup.tsx b/src/components/DownloadBtnGtoup.tsx similarity index 100% rename from components/DownloadBtnGtoup.tsx rename to src/components/DownloadBtnGtoup.tsx diff --git a/components/FileListing.tsx b/src/components/FileListing.tsx similarity index 100% rename from components/FileListing.tsx rename to src/components/FileListing.tsx diff --git a/components/FolderGridLayout.tsx b/src/components/FolderGridLayout.tsx similarity index 98% rename from components/FolderGridLayout.tsx rename to src/components/FolderGridLayout.tsx index 784e8d1..98d7647 100644 --- a/components/FolderGridLayout.tsx +++ b/src/components/FolderGridLayout.tsx @@ -77,7 +77,7 @@ const FolderGridLayout = ({ const getItemPath = (name: string) => `${path === '/' ? '' : path}/${encodeURIComponent(name)}` return ( -
+
{t('{{count}} item(s)', { count: folderChildren.length })}
diff --git a/components/FolderListLayout.tsx b/src/components/FolderListLayout.tsx similarity index 98% rename from components/FolderListLayout.tsx rename to src/components/FolderListLayout.tsx index b13b178..980b980 100644 --- a/components/FolderListLayout.tsx +++ b/src/components/FolderListLayout.tsx @@ -54,7 +54,7 @@ const FolderListLayout = ({ const getItemPath = (name: string) => `${path === '/' ? '' : path}/${encodeURIComponent(name)}` return ( -
+
{t('Name')} diff --git a/components/Footer.tsx b/src/components/Footer.tsx similarity index 88% rename from components/Footer.tsx rename to src/components/Footer.tsx index 1e61d43..5e39c67 100644 --- a/components/Footer.tsx +++ b/src/components/Footer.tsx @@ -1,4 +1,4 @@ -import config from '../config/site.config' +import config from '../../config/site.config' const createFooterMarkup = () => { return { diff --git a/components/FourOhFour.tsx b/src/components/FourOhFour.tsx similarity index 100% rename from components/FourOhFour.tsx rename to src/components/FourOhFour.tsx diff --git a/components/Loading.tsx b/src/components/Loading.tsx similarity index 100% rename from components/Loading.tsx rename to src/components/Loading.tsx diff --git a/components/MultiFileDownloader.tsx b/src/components/MultiFileDownloader.tsx similarity index 100% rename from components/MultiFileDownloader.tsx rename to src/components/MultiFileDownloader.tsx diff --git a/components/Navbar.tsx b/src/components/Navbar.tsx similarity index 99% rename from components/Navbar.tsx rename to src/components/Navbar.tsx index 6cd3c9a..9a7ac24 100644 --- a/components/Navbar.tsx +++ b/src/components/Navbar.tsx @@ -10,7 +10,7 @@ import { useRouter } from 'next/router' import { Fragment, useEffect, useState } from 'react' import { useTranslation } from 'next-i18next' -import siteConfig from '../config/site.config' +import siteConfig from '../../config/site.config' import SearchModal from './SearchModal' import SwitchLang from './SwitchLang' import useDeviceOS from '../utils/useDeviceOS' diff --git a/components/SearchModal.tsx b/src/components/SearchModal.tsx similarity index 99% rename from components/SearchModal.tsx rename to src/components/SearchModal.tsx index 122025c..2b51a95 100644 --- a/components/SearchModal.tsx +++ b/src/components/SearchModal.tsx @@ -15,7 +15,7 @@ import { LoadingIcon } from './Loading' import { getFileIcon } from '../utils/getFileIcon' import { fetcher } from '../utils/fetchWithSWR' -import siteConfig from '../config/site.config' +import siteConfig from '../../config/site.config' /** * Extract the searched item's path in field 'parentReference' and convert it to the diff --git a/components/SwitchLang.tsx b/src/components/SwitchLang.tsx similarity index 100% rename from components/SwitchLang.tsx rename to src/components/SwitchLang.tsx diff --git a/components/SwitchLayout.tsx b/src/components/SwitchLayout.tsx similarity index 100% rename from components/SwitchLayout.tsx rename to src/components/SwitchLayout.tsx diff --git a/components/previews/AudioPreview.tsx b/src/components/previews/AudioPreview.tsx similarity index 100% rename from components/previews/AudioPreview.tsx rename to src/components/previews/AudioPreview.tsx diff --git a/components/previews/CodePreview.tsx b/src/components/previews/CodePreview.tsx similarity index 100% rename from components/previews/CodePreview.tsx rename to src/components/previews/CodePreview.tsx diff --git a/components/previews/Containers.tsx b/src/components/previews/Containers.tsx similarity index 50% rename from components/previews/Containers.tsx rename to src/components/previews/Containers.tsx index 76b980e..757cb16 100644 --- a/components/previews/Containers.tsx +++ b/src/components/previews/Containers.tsx @@ -1,10 +1,10 @@ export function PreviewContainer({ children }): JSX.Element { - return
{children}
+ return
{children}
} export function DownloadBtnContainer({ children }): JSX.Element { return ( -
+
{children}
) diff --git a/components/previews/DefaultPreview.tsx b/src/components/previews/DefaultPreview.tsx similarity index 100% rename from components/previews/DefaultPreview.tsx rename to src/components/previews/DefaultPreview.tsx diff --git a/components/previews/EPUBPreview.tsx b/src/components/previews/EPUBPreview.tsx similarity index 100% rename from components/previews/EPUBPreview.tsx rename to src/components/previews/EPUBPreview.tsx diff --git a/components/previews/ImagePreview.tsx b/src/components/previews/ImagePreview.tsx similarity index 100% rename from components/previews/ImagePreview.tsx rename to src/components/previews/ImagePreview.tsx diff --git a/components/previews/MarkdownPreview.tsx b/src/components/previews/MarkdownPreview.tsx similarity index 100% rename from components/previews/MarkdownPreview.tsx rename to src/components/previews/MarkdownPreview.tsx diff --git a/components/previews/OfficePreview.tsx b/src/components/previews/OfficePreview.tsx similarity index 100% rename from components/previews/OfficePreview.tsx rename to src/components/previews/OfficePreview.tsx diff --git a/components/previews/PDFPreview.tsx b/src/components/previews/PDFPreview.tsx similarity index 100% rename from components/previews/PDFPreview.tsx rename to src/components/previews/PDFPreview.tsx diff --git a/components/previews/TextPreview.tsx b/src/components/previews/TextPreview.tsx similarity index 100% rename from components/previews/TextPreview.tsx rename to src/components/previews/TextPreview.tsx diff --git a/components/previews/URLPreview.tsx b/src/components/previews/URLPreview.tsx similarity index 100% rename from components/previews/URLPreview.tsx rename to src/components/previews/URLPreview.tsx diff --git a/components/previews/VideoPreview.tsx b/src/components/previews/VideoPreview.tsx similarity index 100% rename from components/previews/VideoPreview.tsx rename to src/components/previews/VideoPreview.tsx diff --git a/pages/[...path].tsx b/src/pages/[...path].tsx similarity index 88% rename from pages/[...path].tsx rename to src/pages/[...path].tsx index a7a3e56..0b8dcca 100644 --- a/pages/[...path].tsx +++ b/src/pages/[...path].tsx @@ -2,7 +2,7 @@ import Head from 'next/head' import { useRouter } from 'next/router' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' -import siteConfig from '../config/site.config' +import siteConfig from '../../config/site.config' import Navbar from '../components/Navbar' import FileListing from '../components/FileListing' import Footer from '../components/Footer' @@ -20,8 +20,8 @@ export default function Folders() {
-
-