From 134316934c0afd6cda19e292843eae8cefdab137 Mon Sep 17 00:00:00 2001 From: "Planoetscher Daniel (Student Com20)" <daniel.planoetscher@stud-inf.unibz.it> Date: Thu, 15 Apr 2021 09:32:29 +0200 Subject: [PATCH] new pages and components for later / fixed routing --- client/src/App.tsx | 11 +++++++++-- client/src/adapters/api.ts | 1 + client/src/components/ui/Navigation/index.tsx | 9 +++++++++ client/src/components/ui/Navigation/navigation.scss | 0 client/src/index.scss | 2 +- client/src/pages/Home/index.tsx | 2 +- client/src/pages/Register/index.tsx | 10 ++++++++++ client/src/pages/Register/register.scss | 0 client/src/pages/Tasks/index.tsx | 9 +++++++++ client/src/pages/Tasks/tasks.scss | 0 client/src/styles/settings.scss | 2 +- 11 files changed, 41 insertions(+), 5 deletions(-) create mode 100644 client/src/adapters/api.ts create mode 100644 client/src/components/ui/Navigation/index.tsx create mode 100644 client/src/components/ui/Navigation/navigation.scss create mode 100644 client/src/pages/Register/index.tsx create mode 100644 client/src/pages/Register/register.scss create mode 100644 client/src/pages/Tasks/index.tsx create mode 100644 client/src/pages/Tasks/tasks.scss diff --git a/client/src/App.tsx b/client/src/App.tsx index f7146e7..429313a 100644 --- a/client/src/App.tsx +++ b/client/src/App.tsx @@ -1,17 +1,24 @@ import { Suspense, lazy } from 'react'; import { BrowserRouter as Router, Switch, Route } from 'react-router-dom'; +import { isLoggedIn } from 'adapters/api'; const Home = lazy(() => import('pages/Home')); const Login = lazy(() => import('pages/Login')); +const Register = lazy(() => import('pages/Register')); +const Tasks = lazy(() => import('pages/Tasks')); +const Navigation = lazy(() => import('components/ui/Navigation')); export default function App() { return ( <Router> <Suspense fallback={false}> + {isLoggedIn() && <Navigation />} <Switch> - <Route path="/login" component={Login} /> - <Route path="/" component={Home} /> + {!isLoggedIn() && <Route path="/register" component={Register} />} + {!isLoggedIn() && <Route exact path="/" component={Home} />} + {!isLoggedIn() && <Route path="/" component={Login} />} + <Route path="/" component={Tasks} /> </Switch> </Suspense> </Router> diff --git a/client/src/adapters/api.ts b/client/src/adapters/api.ts new file mode 100644 index 0000000..929c441 --- /dev/null +++ b/client/src/adapters/api.ts @@ -0,0 +1 @@ +export const isLoggedIn = (): boolean => false; diff --git a/client/src/components/ui/Navigation/index.tsx b/client/src/components/ui/Navigation/index.tsx new file mode 100644 index 0000000..d1c633f --- /dev/null +++ b/client/src/components/ui/Navigation/index.tsx @@ -0,0 +1,9 @@ +import './navigation.scss'; + +export default function Navigation() { + return ( + <main> + <h1>Navigation</h1> + </main> + ); +} \ No newline at end of file diff --git a/client/src/components/ui/Navigation/navigation.scss b/client/src/components/ui/Navigation/navigation.scss new file mode 100644 index 0000000..e69de29 diff --git a/client/src/index.scss b/client/src/index.scss index cad66de..526bfef 100644 --- a/client/src/index.scss +++ b/client/src/index.scss @@ -18,7 +18,7 @@ html { body { color: s.$body-color; position: relative; - background: linear-gradient(to left, #e2e2e2 0%, #e6e6e6 100%); + background: linear-gradient(to right, #fff 0%, #f2f2f2 100%); @include mx.breakpoint(xlarge) { padding: 5rem 0; diff --git a/client/src/pages/Home/index.tsx b/client/src/pages/Home/index.tsx index 758eeef..3389eb8 100644 --- a/client/src/pages/Home/index.tsx +++ b/client/src/pages/Home/index.tsx @@ -35,7 +35,7 @@ export default function Home() { <h1>ryoko</h1> <p>Are you feeling lost with your tasks? Maximize your productivity now with ryoko.</p> <div className="button-container"> - <ButtonLink href="#intro">Get started</ButtonLink> + <ButtonLink href="/register" routing={true}>Get started</ButtonLink> </div> </div> </div> diff --git a/client/src/pages/Register/index.tsx b/client/src/pages/Register/index.tsx new file mode 100644 index 0000000..ca7560d --- /dev/null +++ b/client/src/pages/Register/index.tsx @@ -0,0 +1,10 @@ + +import './register.scss'; + +export default function Register() { + return ( + <div> + register + </div> + ); +} \ No newline at end of file diff --git a/client/src/pages/Register/register.scss b/client/src/pages/Register/register.scss new file mode 100644 index 0000000..e69de29 diff --git a/client/src/pages/Tasks/index.tsx b/client/src/pages/Tasks/index.tsx new file mode 100644 index 0000000..9978280 --- /dev/null +++ b/client/src/pages/Tasks/index.tsx @@ -0,0 +1,9 @@ +import './tasks.scss'; + +export default function Tasks() { + return ( + <main> + <h1>Tasks</h1> + </main> + ); +} \ No newline at end of file diff --git a/client/src/pages/Tasks/tasks.scss b/client/src/pages/Tasks/tasks.scss new file mode 100644 index 0000000..e69de29 diff --git a/client/src/styles/settings.scss b/client/src/styles/settings.scss index de925b0..0ecc96b 100644 --- a/client/src/styles/settings.scss +++ b/client/src/styles/settings.scss @@ -19,7 +19,7 @@ $colors: ( $linear-gradient: linear-gradient(to top, $primary, $secondary); $radial-gradient: radial-gradient(100% 115% at 0% 0%, $primary 0%, $secondary 100%); -$body-color: #4B4B4B; +$body-color: #3A5255; $body-font: 'Poppins', sans-serif; // Typography -- GitLab