Skip to content

Commit

Permalink
Use frontend-shared components in CreateGroupForm
Browse files Browse the repository at this point in the history
Use components from our component library (specifically `<Input>`,
`<Textarea>` and `<Button>`) in the `<CreateGroupForm>`.

Instead of using the HTML from h's legacy forms. This legacy HTML
doesn't work anymore anyway because the CSS it depends on is now
isolated from the Preact app by shadow DOM.
  • Loading branch information
seanh committed Jul 5, 2024
1 parent 4803c83 commit 88e435f
Showing 1 changed file with 9 additions and 16 deletions.
25 changes: 9 additions & 16 deletions h/static/scripts/group-forms/components/CreateGroupForm.tsx
Original file line number Diff line number Diff line change
@@ -1,36 +1,29 @@
import { Button, Input, Textarea } from '@hypothesis/frontend-shared';

export default function CreateGroupForm() {
return (
<>
<h1>Create a new private group</h1>

<form>
<div>
<label for="name">
Name <span>*</span>
</label>
<input type="text" id="name" autofocus autocomplete="off" required />
<span>0/25</span>
<label for="name">Name*</label>
<Input id="name" autofocus autocomplete="off" required />
0/25
</div>

<div>
<label for="description">Description</label>
<textarea id="description"></textarea>
<span>0/250</span>
<Textarea id="description" />
0/250
</div>

<div>
<div>
<button>Create group</button>
</div>
<Button variant="primary">Create group</Button>
</div>
</form>

<footer>
<span>
<span>*</span>
<span>Required</span>
</span>
</footer>
<footer>*Required</footer>
</>
);
}

0 comments on commit 88e435f

Please sign in to comment.