diff options
| author | Sam Nystrom <sam@samnystrom.dev> | 2024-03-13 05:03:22 +0000 |
|---|---|---|
| committer | Sam Nystrom <sam@samnystrom.dev> | 2024-03-13 20:17:07 -0400 |
| commit | 052cc1a5a4668d7cb17fb273a022aa5b820d1faa (patch) | |
| tree | dbce2d2d10bb8c3cc81e38beeb2c1a3c8268c2f8 /src/pages/LogIn.tsx | |
| parent | 570f47670bf9f361eeb073b9124be56465498c83 (diff) | |
refactor: move styles into separate components
Diffstat (limited to 'src/pages/LogIn.tsx')
| -rw-r--r-- | src/pages/LogIn.tsx | 45 |
1 files changed, 24 insertions, 21 deletions
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 ( - <main> - <form onSubmit={onSubmit}> - <h1>Log In</h1> - <p> - Don't have an account? <a href="/signup">Sign up</a> - </p> - <hr /> - <label> - Email - <input type="text" placeholder="Email" value={email} onInput={e => email.value = e.target.value} /> - </label> - <label> - Password - <input type="password" placeholder="Password" value={password} onInput={e => password.value = e.target.value} /> - </label> - <input type="submit" value="Continue" /> - </form> - </main> + <Content> + <Form onSubmit={onSubmit}> + <h1>Log In</h1> + <p> + Don't have an account? <a href="/signup">Sign up</a> + </p> + <hr /> + <FormLabel> + Email + <TextInput placeholder="Email" signal={email} /> + </FormLabel> + <FormLabel> + Password + <TextInput type="password" placeholder="Email" signal={email} /> + </FormLabel> + <ArrowButton>Continue</ArrowButton> + </Form> + </Content> ); -};
\ No newline at end of file +}; + +export default LogIn;
\ No newline at end of file |
