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/ProjectsList.tsx | |
| parent | 570f47670bf9f361eeb073b9124be56465498c83 (diff) | |
refactor: move styles into separate components
Diffstat (limited to 'src/pages/ProjectsList.tsx')
| -rw-r--r-- | src/pages/ProjectsList.tsx | 35 |
1 files changed, 18 insertions, 17 deletions
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 ( - <main class="container"> + <Content> <h1>{user}'s Projects</h1> - <form onSubmit={onCreateProject}> - <fieldset class="group"> - <label> - Name - <input type="text" placeholder="Project name" value={projectName} onInput={e => projectName.value = e.target.value} /> - </label> - <input type="submit" value="Create project" /> - </fieldset> - </form> - <ul class="contained"> + <Form onSubmit={onCreateProject}> + <FormLabel> + Name + <TextInput placeholder="Project name" signal={projectName} /> + </FormLabel> + <Button>Create project</Button> + </Form> + <ContainedList> {projects.value.items.map(p => ( - <li><a class="action" href={`/${user}/${p.name}`}>{p.name}</a></li> + <li><Button kind="ghost" href={`/${user}/${p.name}`}>{p.name}</Button></li> ))} - </ul> - </main> + </ContainedList> + </Content> ); -};
\ No newline at end of file +}; + +export default ProjectsList;
\ No newline at end of file |
