From 04668cb293d9d93128a13e0a454942a5d8c1153c Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:08:47 -0500 Subject: [PATCH 1/9] move Footer files to new folder --- components/Footer/Footer.tsx | 16 ++++++++++++++++ components/Footer/index.tsx | 1 + 2 files changed, 17 insertions(+) create mode 100644 components/Footer/Footer.tsx create mode 100644 components/Footer/index.tsx diff --git a/components/Footer/Footer.tsx b/components/Footer/Footer.tsx new file mode 100644 index 000000000..0b7f25bfa --- /dev/null +++ b/components/Footer/Footer.tsx @@ -0,0 +1,16 @@ +import React from 'react' + +type Props = { + footerType?: string +} + +const Footer: React.FC = ({ footerType }) => { + const footerClass = footerType + ? `fw-light text-center ${footerType}` + : `mt-5 fw-light text-center pb-5 text-muted` + return ( +
© Copyright 2022 GarageScript
+ ) +} + +export default Footer diff --git a/components/Footer/index.tsx b/components/Footer/index.tsx new file mode 100644 index 000000000..5d06e9b71 --- /dev/null +++ b/components/Footer/index.tsx @@ -0,0 +1 @@ +export { default } from './Footer' From ae8ca1994ab7bf2aead626476c32284a282b8436 Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:12:31 -0500 Subject: [PATCH 2/9] delete dup file --- components/Footer.tsx | 16 ---------------- 1 file changed, 16 deletions(-) delete mode 100644 components/Footer.tsx diff --git a/components/Footer.tsx b/components/Footer.tsx deleted file mode 100644 index 0b7f25bfa..000000000 --- a/components/Footer.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import React from 'react' - -type Props = { - footerType?: string -} - -const Footer: React.FC = ({ footerType }) => { - const footerClass = footerType - ? `fw-light text-center ${footerType}` - : `mt-5 fw-light text-center pb-5 text-muted` - return ( -
© Copyright 2022 GarageScript
- ) -} - -export default Footer From 41454c86c02eb114e2ab63365ecdd7f8f6b4ac5e Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:14:51 -0500 Subject: [PATCH 3/9] move Input files to new folder --- components/{ => Input}/Input.tsx | 0 components/Input/index.tsx | 1 + 2 files changed, 1 insertion(+) rename components/{ => Input}/Input.tsx (100%) create mode 100644 components/Input/index.tsx diff --git a/components/Input.tsx b/components/Input/Input.tsx similarity index 100% rename from components/Input.tsx rename to components/Input/Input.tsx diff --git a/components/Input/index.tsx b/components/Input/index.tsx new file mode 100644 index 000000000..aa97178e5 --- /dev/null +++ b/components/Input/index.tsx @@ -0,0 +1 @@ +export { default } from './Input' From 9614fa472a9174a384bc9986ed5b59eb8dbb0261 Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:18:24 -0500 Subject: [PATCH 4/9] move InputGroup files to new folder --- components/{ => InputGroup}/InputGroup.tsx | 0 components/InputGroup/index.tsx | 1 + 2 files changed, 1 insertion(+) rename components/{ => InputGroup}/InputGroup.tsx (100%) create mode 100644 components/InputGroup/index.tsx diff --git a/components/InputGroup.tsx b/components/InputGroup/InputGroup.tsx similarity index 100% rename from components/InputGroup.tsx rename to components/InputGroup/InputGroup.tsx diff --git a/components/InputGroup/index.tsx b/components/InputGroup/index.tsx new file mode 100644 index 000000000..2728c4f8b --- /dev/null +++ b/components/InputGroup/index.tsx @@ -0,0 +1 @@ +export { default } from './InputGroup' From d71509fbc5bd8d47875128ac1dc569aa03e62ea9 Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:31:14 -0500 Subject: [PATCH 5/9] move Layout files to new folder and update imports --- components/{ => Layout}/Layout.tsx | 6 +++--- components/Layout/index.tsx | 1 + components/admin/AdminLayout.tsx | 2 +- 3 files changed, 5 insertions(+), 4 deletions(-) rename components/{ => Layout}/Layout.tsx (80%) create mode 100644 components/Layout/index.tsx diff --git a/components/Layout.tsx b/components/Layout/Layout.tsx similarity index 80% rename from components/Layout.tsx rename to components/Layout/Layout.tsx index 24b6460a1..7d481cbbb 100644 --- a/components/Layout.tsx +++ b/components/Layout/Layout.tsx @@ -1,8 +1,8 @@ import React from 'react' -import AppNav from './AppNav' -import Footer from './Footer' +import AppNav from '../AppNav' +import Footer from '../Footer' import Head from 'next/head' -import type { LayoutGetter } from '../@types/page' +import type { LayoutGetter } from '../../@types/page' import styles from '../scss/layout.module.scss' const Layout: React.FC<{ title?: string }> = ({ children, title }) => ( diff --git a/components/Layout/index.tsx b/components/Layout/index.tsx new file mode 100644 index 000000000..c5cb53404 --- /dev/null +++ b/components/Layout/index.tsx @@ -0,0 +1 @@ +export { getLayout, default } from './Layout' diff --git a/components/admin/AdminLayout.tsx b/components/admin/AdminLayout.tsx index e44ca4a26..3a60404c4 100644 --- a/components/admin/AdminLayout.tsx +++ b/components/admin/AdminLayout.tsx @@ -1,6 +1,6 @@ import React from 'react' import LoadingSpinner from '../../components/LoadingSpinner' -import Layout from '../../components/Layout' +import Layout from '../Layout' import _ from 'lodash' import { GetAppProps } from '../../graphql' import Error, { StatusCode } from '../../components/Error' From 5e8cb7d6c630f5872b95e39c8525502a5cd298d0 Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:45:08 -0500 Subject: [PATCH 6/9] move LoadingSpinner files to new folder --- components/{ => LoadingSpinner}/LoadingSpinner.tsx | 0 components/LoadingSpinner/index.tsx | 1 + components/admin/AdminLayout.tsx | 3 ++- 3 files changed, 3 insertions(+), 1 deletion(-) rename components/{ => LoadingSpinner}/LoadingSpinner.tsx (100%) create mode 100644 components/LoadingSpinner/index.tsx diff --git a/components/LoadingSpinner.tsx b/components/LoadingSpinner/LoadingSpinner.tsx similarity index 100% rename from components/LoadingSpinner.tsx rename to components/LoadingSpinner/LoadingSpinner.tsx diff --git a/components/LoadingSpinner/index.tsx b/components/LoadingSpinner/index.tsx new file mode 100644 index 000000000..365fa60ff --- /dev/null +++ b/components/LoadingSpinner/index.tsx @@ -0,0 +1 @@ +export { default } from './LoadingSpinner' diff --git a/components/admin/AdminLayout.tsx b/components/admin/AdminLayout.tsx index 3a60404c4..682c1e46e 100644 --- a/components/admin/AdminLayout.tsx +++ b/components/admin/AdminLayout.tsx @@ -1,10 +1,11 @@ import React from 'react' -import LoadingSpinner from '../../components/LoadingSpinner' +import LoadingSpinner from '../LoadingSpinner' import Layout from '../Layout' import _ from 'lodash' import { GetAppProps } from '../../graphql' import Error, { StatusCode } from '../../components/Error' import { useRouter } from 'next/router' + export const AdminLayout: React.FC = ({ data, children From 476b6ed1b9ca8f1453a1ca132c9a27705e4c1170 Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 14:49:03 -0500 Subject: [PATCH 7/9] add React.FC type annotoation for component --- components/LoadingSpinner/LoadingSpinner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/LoadingSpinner/LoadingSpinner.tsx b/components/LoadingSpinner/LoadingSpinner.tsx index 3c6af069f..3cd29b9e7 100644 --- a/components/LoadingSpinner/LoadingSpinner.tsx +++ b/components/LoadingSpinner/LoadingSpinner.tsx @@ -1,6 +1,6 @@ import React from 'react' -const LoadingSpinner = () => { +const LoadingSpinner: React.FC<{}> = () => { return (
Date: Fri, 21 Apr 2023 14:52:38 -0500 Subject: [PATCH 8/9] move Layout scss module --- components/Layout/Layout.tsx | 2 +- {scss => components/Layout}/layout.module.scss | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename {scss => components/Layout}/layout.module.scss (100%) diff --git a/components/Layout/Layout.tsx b/components/Layout/Layout.tsx index 7d481cbbb..43f9c5a65 100644 --- a/components/Layout/Layout.tsx +++ b/components/Layout/Layout.tsx @@ -3,7 +3,7 @@ import AppNav from '../AppNav' import Footer from '../Footer' import Head from 'next/head' import type { LayoutGetter } from '../../@types/page' -import styles from '../scss/layout.module.scss' +import styles from './layout.module.scss' const Layout: React.FC<{ title?: string }> = ({ children, title }) => ( <> diff --git a/scss/layout.module.scss b/components/Layout/layout.module.scss similarity index 100% rename from scss/layout.module.scss rename to components/Layout/layout.module.scss From 4628fd7a20f70e8888186235cf5d2fe7e8a3f1a6 Mon Sep 17 00:00:00 2001 From: Scott Hallock Date: Fri, 21 Apr 2023 15:11:38 -0500 Subject: [PATCH 9/9] revert adding type annotation to LoadingSpinner --- components/LoadingSpinner/LoadingSpinner.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/LoadingSpinner/LoadingSpinner.tsx b/components/LoadingSpinner/LoadingSpinner.tsx index 3cd29b9e7..3c6af069f 100644 --- a/components/LoadingSpinner/LoadingSpinner.tsx +++ b/components/LoadingSpinner/LoadingSpinner.tsx @@ -1,6 +1,6 @@ import React from 'react' -const LoadingSpinner: React.FC<{}> = () => { +const LoadingSpinner = () => { return (