From d44d27e8b103976177e397843d34aa527dad8d61 Mon Sep 17 00:00:00 2001 From: Noah Spannbauer Date: Wed, 22 May 2024 19:54:09 -0500 Subject: [PATCH] renaming client to app --- {client => app}/.eslintrc.cjs | 8 +- {client => app}/.gitignore | 0 {client => app}/README.md | 4 +- {client => app}/index.html | 0 {client => app}/package-lock.json | 0 {client => app}/package.json | 0 {client => app}/postcss.config.js | 4 +- {client => app}/public/vite.svg | 0 {client => app}/src/App.tsx | 11 +- {client => app}/src/assets/react.svg | 0 app/src/components/logbook/Logbook.tsx | 12 ++ .../logbookEntryForm/LogbookEntryForm.tsx | 122 ++++++++++++++++ app/src/components/pilotForm/PilotForm.tsx | 85 +++++++++++ app/src/components/pilots/Pilots.tsx | 15 ++ app/src/components/siteNav/SiteNav.tsx | 59 ++++++++ {client => app}/src/index.css | 0 {client => app}/src/main.tsx | 7 +- {client => app}/src/vite-env.d.ts | 0 {client => app}/tailwind.config.js | 6 +- {client => app}/tsconfig.json | 0 {client => app}/tsconfig.node.json | 0 {client => app}/vite.config.ts | 2 +- client/src/components/logbook/Logbook.tsx | 14 -- .../logbookEntryForm/LogbookEntryForm.tsx | 138 ------------------ client/src/components/pilotForm/PilotForm.tsx | 83 ----------- client/src/components/pilots/Pilots.tsx | 15 -- client/src/components/siteNav/SiteNav.tsx | 53 ------- 27 files changed, 314 insertions(+), 324 deletions(-) rename {client => app}/.eslintrc.cjs (80%) rename {client => app}/.gitignore (100%) rename {client => app}/README.md (97%) rename {client => app}/index.html (100%) rename {client => app}/package-lock.json (100%) rename {client => app}/package.json (100%) rename {client => app}/postcss.config.js (66%) rename {client => app}/public/vite.svg (100%) rename {client => app}/src/App.tsx (63%) rename {client => app}/src/assets/react.svg (100%) create mode 100644 app/src/components/logbook/Logbook.tsx create mode 100644 app/src/components/logbookEntryForm/LogbookEntryForm.tsx create mode 100644 app/src/components/pilotForm/PilotForm.tsx create mode 100644 app/src/components/pilots/Pilots.tsx create mode 100644 app/src/components/siteNav/SiteNav.tsx rename {client => app}/src/index.css (100%) rename {client => app}/src/main.tsx (87%) rename {client => app}/src/vite-env.d.ts (100%) rename {client => app}/tailwind.config.js (87%) rename {client => app}/tsconfig.json (100%) rename {client => app}/tsconfig.node.json (100%) rename {client => app}/vite.config.ts (86%) delete mode 100644 client/src/components/logbook/Logbook.tsx delete mode 100644 client/src/components/logbookEntryForm/LogbookEntryForm.tsx delete mode 100644 client/src/components/pilotForm/PilotForm.tsx delete mode 100644 client/src/components/pilots/Pilots.tsx delete mode 100644 client/src/components/siteNav/SiteNav.tsx diff --git a/client/.eslintrc.cjs b/app/.eslintrc.cjs similarity index 80% rename from client/.eslintrc.cjs rename to app/.eslintrc.cjs index 4c99537..ee8cdb2 100644 --- a/client/.eslintrc.cjs +++ b/app/.eslintrc.cjs @@ -4,7 +4,7 @@ module.exports = { extends: [ 'eslint:recommended', 'plugin:@typescript-eslint/recommended', - 'plugin:react-hooks/recommended', + 'plugin:react-hooks/recommended' ], ignorePatterns: ['dist', '.eslintrc.cjs'], parser: '@typescript-eslint/parser', @@ -12,7 +12,7 @@ module.exports = { rules: { 'react-refresh/only-export-components': [ 'warn', - { allowConstantExport: true }, - ], - }, + { allowConstantExport: true } + ] + } }; diff --git a/client/.gitignore b/app/.gitignore similarity index 100% rename from client/.gitignore rename to app/.gitignore diff --git a/client/README.md b/app/README.md similarity index 97% rename from client/README.md rename to app/README.md index 9d0b4bc..09ff6fc 100644 --- a/client/README.md +++ b/app/README.md @@ -20,8 +20,8 @@ export default { ecmaVersion: 'latest', sourceType: 'module', project: ['./tsconfig.json', './tsconfig.node.json'], - tsconfigRootDir: __dirname, - }, + tsconfigRootDir: __dirname + } }; ``` diff --git a/client/index.html b/app/index.html similarity index 100% rename from client/index.html rename to app/index.html diff --git a/client/package-lock.json b/app/package-lock.json similarity index 100% rename from client/package-lock.json rename to app/package-lock.json diff --git a/client/package.json b/app/package.json similarity index 100% rename from client/package.json rename to app/package.json diff --git a/client/postcss.config.js b/app/postcss.config.js similarity index 66% rename from client/postcss.config.js rename to app/postcss.config.js index 2aa7205..ba80730 100644 --- a/client/postcss.config.js +++ b/app/postcss.config.js @@ -1,6 +1,6 @@ export default { plugins: { tailwindcss: {}, - autoprefixer: {}, - }, + autoprefixer: {} + } }; diff --git a/client/public/vite.svg b/app/public/vite.svg similarity index 100% rename from client/public/vite.svg rename to app/public/vite.svg diff --git a/client/src/App.tsx b/app/src/App.tsx similarity index 63% rename from client/src/App.tsx rename to app/src/App.tsx index 43f463c..3331d63 100644 --- a/client/src/App.tsx +++ b/app/src/App.tsx @@ -4,16 +4,15 @@ import Logbook from './components/logbook/Logbook'; import Checklists from './components/checklists/Checklists'; import Pilots from './components/pilots/Pilots'; - const App: React.FC = () => { return ( - } /> - } /> - } /> - } /> + } /> + } /> + } /> + } /> ); -} +}; export default App; diff --git a/client/src/assets/react.svg b/app/src/assets/react.svg similarity index 100% rename from client/src/assets/react.svg rename to app/src/assets/react.svg diff --git a/app/src/components/logbook/Logbook.tsx b/app/src/components/logbook/Logbook.tsx new file mode 100644 index 0000000..cd29641 --- /dev/null +++ b/app/src/components/logbook/Logbook.tsx @@ -0,0 +1,12 @@ +import SiteNav from '../siteNav/SiteNav'; + +const Logbook: React.FC = () => { + return ( +
+ +
Logbook goes here
+
+ ); +}; + +export default Logbook; diff --git a/app/src/components/logbookEntryForm/LogbookEntryForm.tsx b/app/src/components/logbookEntryForm/LogbookEntryForm.tsx new file mode 100644 index 0000000..18d53db --- /dev/null +++ b/app/src/components/logbookEntryForm/LogbookEntryForm.tsx @@ -0,0 +1,122 @@ +import React from 'react'; +import { + Accordion, + AccordionItem, + Button, + DatePicker, + Input +} from '@nextui-org/react'; +import { useForm, Controller, SubmitHandler } from 'react-hook-form'; + +const LogbookEntryForm: React.FC = () => { + const { control, handleSubmit } = useForm(); + + const onSubmit = (data: unknown) => { + console.log(data); + }; + + return ( +
+
+
+ +
+
+ } + /> +
+
+ +
+
+ ( + + )} + /> +
+
+ +
+
+ ( + + )} + /> +
+
+ +
+
+ } + /> +
+
+ +
+
+ } + /> +
+
+ +
+
+ } + /> +
+
+ +
+
+ } + /> +
+
+ + +
+ +
+
+ } + /> +
+
+
+
+
+ + +
+
+
+ ); +}; + +export default LogbookEntryForm; diff --git a/app/src/components/pilotForm/PilotForm.tsx b/app/src/components/pilotForm/PilotForm.tsx new file mode 100644 index 0000000..9bb6e3f --- /dev/null +++ b/app/src/components/pilotForm/PilotForm.tsx @@ -0,0 +1,85 @@ +import { + Accordion, + AccordionItem, + Button, + DatePicker, + Input, + Select, + SelectItem +} from '@nextui-org/react'; +import { useForm, Controller, SubmitHandler } from 'react-hook-form'; + +const PilotForm: React.FC = () => { + const { control, handleSubmit } = useForm(); + + const onSubmit = (data: unknown) => { + console.log(data); + }; + + return ( +
+
+
+ +
+
+ } + /> +
+
+ +
+
+ } + /> +
+
+ + +
+
+ +
+
+ ( + + )} + /> +
+
+ +
+
+ } + /> +
+
+
+
+
+ ); +}; + +export default PilotForm; diff --git a/app/src/components/pilots/Pilots.tsx b/app/src/components/pilots/Pilots.tsx new file mode 100644 index 0000000..8bd5df7 --- /dev/null +++ b/app/src/components/pilots/Pilots.tsx @@ -0,0 +1,15 @@ +import SiteNav from '../siteNav/SiteNav'; +import PilotForm from '../pilotForm/PilotForm'; + +const Pilots: React.FC = () => { + return ( +
+ +
+ +
+
+ ); +}; + +export default Pilots; diff --git a/app/src/components/siteNav/SiteNav.tsx b/app/src/components/siteNav/SiteNav.tsx new file mode 100644 index 0000000..0bd14e8 --- /dev/null +++ b/app/src/components/siteNav/SiteNav.tsx @@ -0,0 +1,59 @@ +import { + Avatar, + Link, + Navbar, + NavbarBrand, + NavbarContent, + NavbarItem, + Button +} from '@nextui-org/react'; +import { Link as ReactRouterLink } from 'react-router-dom'; +import { useIsAuthenticated, useMsal } from '@azure/msal-react'; + +const SiteNav: React.FC = () => { + const isAuthenticated = useIsAuthenticated(); + const { accounts, instance } = useMsal(); + const initializeLogin = () => { + instance.loginRedirect(); + }; + + console.log(accounts); + + return ( + + Site Logo Goes Here + + + + Flights + + + + + Logbook + + + + + Checklists + + + + + Pilots + + + + + {!isAuthenticated && ( + + )} + {isAuthenticated && } + + + ); +}; + +export default SiteNav; diff --git a/client/src/index.css b/app/src/index.css similarity index 100% rename from client/src/index.css rename to app/src/index.css diff --git a/client/src/main.tsx b/app/src/main.tsx similarity index 87% rename from client/src/main.tsx rename to app/src/main.tsx index 2e7256d..f10596f 100644 --- a/client/src/main.tsx +++ b/app/src/main.tsx @@ -10,10 +10,11 @@ import { BrowserRouter } from 'react-router-dom'; const configuration: Configuration = { auth: { clientId: 'd3562a45-050d-4f9a-baed-0497c7156924', - authority: 'https://login.microsoftonline.com/0f23652e-4b15-420f-991e-3d6fc769a31d', + authority: + 'https://login.microsoftonline.com/0f23652e-4b15-420f-991e-3d6fc769a31d', redirectUri: 'http://localhost:5173' } -} +}; const pca = new PublicClientApplication(configuration); @@ -26,5 +27,5 @@ ReactDOM.createRoot(document.getElementById('root')!).render( - , + ); diff --git a/client/src/vite-env.d.ts b/app/src/vite-env.d.ts similarity index 100% rename from client/src/vite-env.d.ts rename to app/src/vite-env.d.ts diff --git a/client/tailwind.config.js b/app/tailwind.config.js similarity index 87% rename from client/tailwind.config.js rename to app/tailwind.config.js index 7ea7a5d..7b9c96b 100644 --- a/client/tailwind.config.js +++ b/app/tailwind.config.js @@ -5,11 +5,11 @@ export default { content: [ './index.html', './src/**/*.{js,ts,jsx,tsx}', - './node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}', + './node_modules/@nextui-org/theme/dist/**/*.{js,ts,jsx,tsx}' ], theme: { - extend: {}, + extend: {} }, darkMode: 'class', - plugins: [nextui()], + plugins: [nextui()] }; diff --git a/client/tsconfig.json b/app/tsconfig.json similarity index 100% rename from client/tsconfig.json rename to app/tsconfig.json diff --git a/client/tsconfig.node.json b/app/tsconfig.node.json similarity index 100% rename from client/tsconfig.node.json rename to app/tsconfig.node.json diff --git a/client/vite.config.ts b/app/vite.config.ts similarity index 86% rename from client/vite.config.ts rename to app/vite.config.ts index 627a319..6549182 100644 --- a/client/vite.config.ts +++ b/app/vite.config.ts @@ -3,5 +3,5 @@ import react from '@vitejs/plugin-react'; // https://vitejs.dev/config/ export default defineConfig({ - plugins: [react()], + plugins: [react()] }); diff --git a/client/src/components/logbook/Logbook.tsx b/client/src/components/logbook/Logbook.tsx deleted file mode 100644 index 16b1017..0000000 --- a/client/src/components/logbook/Logbook.tsx +++ /dev/null @@ -1,14 +0,0 @@ -import SiteNav from '../siteNav/SiteNav'; - -const Logbook: React.FC = () => { - return ( -
- -
- Logbook goes here -
-
- ) -} - -export default Logbook; \ No newline at end of file diff --git a/client/src/components/logbookEntryForm/LogbookEntryForm.tsx b/client/src/components/logbookEntryForm/LogbookEntryForm.tsx deleted file mode 100644 index 5c52efb..0000000 --- a/client/src/components/logbookEntryForm/LogbookEntryForm.tsx +++ /dev/null @@ -1,138 +0,0 @@ -import React from 'react'; -import { Accordion, AccordionItem, Button, DatePicker, Input } from '@nextui-org/react'; -import { useForm, Controller, SubmitHandler } from 'react-hook-form'; - -const LogbookEntryForm: React.FC = () => { - const { control, handleSubmit } = useForm(); - - const onSubmit = (data: unknown) => { - console.log(data) - } - - return ( -
-
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- - -
- -
-
- ( - - )} - /> -
-
-
-
-
- - -
-
-
- ) -} - -export default LogbookEntryForm; \ No newline at end of file diff --git a/client/src/components/pilotForm/PilotForm.tsx b/client/src/components/pilotForm/PilotForm.tsx deleted file mode 100644 index dcc75a3..0000000 --- a/client/src/components/pilotForm/PilotForm.tsx +++ /dev/null @@ -1,83 +0,0 @@ -import { Accordion, AccordionItem, Button, DatePicker, Input, Select, SelectItem } from '@nextui-org/react'; -import { useForm, Controller, SubmitHandler } from 'react-hook-form'; - -const PilotForm: React.FC = () => { - const { control, handleSubmit } = useForm(); - - const onSubmit = (data: unknown) => { - console.log(data); - } - - return ( -
-
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
- - -
-
- -
-
- ( - - )} - /> -
-
- -
-
- ( - - )} - /> -
-
-
-
-
- ) -} - -export default PilotForm; \ No newline at end of file diff --git a/client/src/components/pilots/Pilots.tsx b/client/src/components/pilots/Pilots.tsx deleted file mode 100644 index d819872..0000000 --- a/client/src/components/pilots/Pilots.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import SiteNav from '../siteNav/SiteNav'; -import PilotForm from '../pilotForm/PilotForm'; - -const Pilots: React.FC = () => { - return ( -
- -
- -
-
- ) -} - -export default Pilots; \ No newline at end of file diff --git a/client/src/components/siteNav/SiteNav.tsx b/client/src/components/siteNav/SiteNav.tsx deleted file mode 100644 index 8ca69e0..0000000 --- a/client/src/components/siteNav/SiteNav.tsx +++ /dev/null @@ -1,53 +0,0 @@ -import { Avatar, Link, Navbar, NavbarBrand, NavbarContent, NavbarItem, Button } from '@nextui-org/react'; -import { Link as ReactRouterLink } from 'react-router-dom'; -import { useIsAuthenticated, useMsal } from '@azure/msal-react'; - -const SiteNav: React.FC = () => { - const isAuthenticated = useIsAuthenticated(); - const { accounts, instance } = useMsal(); - const initializeLogin = () => { - instance.loginRedirect(); - } - - console.log(accounts) - - return ( - - - Site Logo Goes Here - - - - - Flights - - - - - Logbook - - - - - Checklists - - - - - Pilots - - - - - {!isAuthenticated && - - } - {isAuthenticated && - - } - - - ) -} - -export default SiteNav; \ No newline at end of file