From 052cc1a5a4668d7cb17fb273a022aa5b820d1faa Mon Sep 17 00:00:00 2001 From: Sam Nystrom Date: Wed, 13 Mar 2024 05:03:22 +0000 Subject: refactor: move styles into separate components --- src/pages/Home.tsx | 16 +++++++----- src/pages/LogIn.tsx | 45 ++++++++++++++++++---------------- src/pages/ProjectsList.tsx | 35 +++++++++++++------------- src/pages/SignUp.tsx | 61 ++++++++++++++++++++++++---------------------- src/pages/index.ts | 8 +++--- 5 files changed, 88 insertions(+), 77 deletions(-) (limited to 'src/pages') diff --git a/src/pages/Home.tsx b/src/pages/Home.tsx index 7762636..f177a75 100644 --- a/src/pages/Home.tsx +++ b/src/pages/Home.tsx @@ -1,8 +1,12 @@ -export const Home = () => { +import { Content } from '../components'; + +const Home = () => { return ( -
- Sign Up - Log In -
+ +

Try Now

+

Create Account

+
); -}; \ No newline at end of file +}; + +export default Home; \ No newline at end of file diff --git a/src/pages/LogIn.tsx b/src/pages/LogIn.tsx index 55b2109..7e83f98 100644 --- a/src/pages/LogIn.tsx +++ b/src/pages/LogIn.tsx @@ -1,9 +1,10 @@ import { useContext } from 'preact/hooks'; import { useSignal } from '@preact/signals'; import { route } from 'preact-router'; -import { Pb } from '../pb.ts'; +import { Pb } from '../context.ts'; +import { TextInput, ArrowButton, FormLabel, Content, Form } from '../components'; -export const LogIn = () => { +const LogIn = () => { const pb = useContext(Pb); const email = useSignal(''); @@ -18,23 +19,25 @@ export const LogIn = () => { }; return ( -
-
-

Log In

-

- Don't have an account? Sign up -

-
- - - -
-
+ +
+

Log In

+

+ Don't have an account? Sign up +

+
+ + Email + + + + Password + + + Continue +
+
); -}; \ No newline at end of file +}; + +export default LogIn; \ No newline at end of file diff --git a/src/pages/ProjectsList.tsx b/src/pages/ProjectsList.tsx index 820c457..d548aa7 100644 --- a/src/pages/ProjectsList.tsx +++ b/src/pages/ProjectsList.tsx @@ -1,9 +1,10 @@ import { useContext, useEffect } from 'preact/hooks'; import { useSignal } from '@preact/signals'; import { route } from 'preact-router'; -import { Pb } from '../pb.ts'; +import { Pb } from '../context.ts'; +import { TextInput, Button, Form, FormLabel, ContainedList, Content } from '../components'; -export const ProjectsList = ({ user }) => { +const ProjectsList = ({ user }) => { console.log(user); const pb = useContext(Pb); const projects = useSignal(null); @@ -30,22 +31,22 @@ export const ProjectsList = ({ user }) => { ); } return ( -
+

{user}'s Projects

-
-
- - -
-
-
    +
    + + Name + + + +
    + {projects.value.items.map(p => ( -
  • {p.name}
  • +
  • ))} -
-
+ + ); -}; \ No newline at end of file +}; + +export default ProjectsList; \ No newline at end of file diff --git a/src/pages/SignUp.tsx b/src/pages/SignUp.tsx index b707b7d..8bdf35b 100644 --- a/src/pages/SignUp.tsx +++ b/src/pages/SignUp.tsx @@ -1,9 +1,10 @@ import { useContext } from 'preact/hooks'; import { useSignal } from '@preact/signals'; import { route } from 'preact-router'; -import { Pb } from '../pb.ts'; +import { Pb } from '../context.ts'; +import { TextInput, ArrowButton, Form, FormLabel, Content } from '../components'; -export const SignUp = () => { +const SignUp = () => { const pb = useContext(Pb); const username = useSignal(''); @@ -26,31 +27,33 @@ export const SignUp = () => { }; return ( -
-
-

Sign Up

-

- Already have an account? Log in -

-
- - - - - -
-
+ +
+

Sign Up

+

+ Already have an account? Log in +

+
+ + Username + + + + Email + + + + Password + + + + Confirm password + + + Continue +
+
); -}; \ No newline at end of file +}; + +export default SignUp; \ No newline at end of file diff --git a/src/pages/index.ts b/src/pages/index.ts index 8b28ea6..bd162cf 100644 --- a/src/pages/index.ts +++ b/src/pages/index.ts @@ -1,4 +1,4 @@ -export { Home } from './Home.tsx'; -export { SignUp } from './SignUp.tsx'; -export { LogIn } from './LogIn.tsx'; -export { ProjectsList } from './ProjectsList.tsx'; \ No newline at end of file +export { default as Home } from './Home.tsx'; +export { default as SignUp } from './SignUp.tsx'; +export { default as LogIn } from './LogIn.tsx'; +export { default as ProjectsList } from './ProjectsList.tsx'; \ No newline at end of file -- cgit v1.2.3