Skip to content

Commit

Permalink
Re-order components in CreateGroupForm.txt
Browse files Browse the repository at this point in the history
The convention in our .tsx files is to put the main/exported component
at the bottom and internal components or other helpers above.
  • Loading branch information
seanh committed Jul 10, 2024
1 parent 1a61b30 commit 2eed560
Showing 1 changed file with 30 additions and 30 deletions.
60 changes: 30 additions & 30 deletions h/static/scripts/group-forms/components/CreateGroupForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,36 @@ import { useId } from 'preact/hooks';

import { Button, Input, Textarea } from '@hypothesis/frontend-shared';

function Star() {
return <span className="text-brand">*</span>;
}

function CharacterCounter({ value, limit }: { value: number; limit: number }) {
return (
<div className="flex">
<div className="grow" />
{value}/{limit}
</div>
);
}

function Label({
htmlFor,
text,
required,
}: {
htmlFor: string;
text: string;
required?: boolean;
}) {
return (
<label htmlFor={htmlFor}>
{text}
{required ? <Star /> : null}
</label>
);
}

export default function CreateGroupForm() {
const nameId = useId();
const descriptionId = useId();
Expand Down Expand Up @@ -41,33 +71,3 @@ export default function CreateGroupForm() {
</div>
);
}

function CharacterCounter({ value, limit }: { value: number; limit: number }) {
return (
<div className="flex">
<div className="grow" />
{value}/{limit}
</div>
);
}

function Label({
htmlFor,
text,
required,
}: {
htmlFor: string;
text: string;
required?: boolean;
}) {
return (
<label htmlFor={htmlFor}>
{text}
{required ? <Star /> : null}
</label>
);
}

function Star() {
return <span className="text-brand">*</span>;
}

0 comments on commit 2eed560

Please sign in to comment.