Skip to content

Commit

Permalink
fix submit buttons
Browse files Browse the repository at this point in the history
  • Loading branch information
buckhalt committed Jun 6, 2024
1 parent e17f537 commit 5063f9b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
2 changes: 1 addition & 1 deletion app/[org]/_components/CreateOrgForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ export default function CreateOrgForm() {
name="orgName"
placeholder="Northwestern"
/>
<Button>Create Org</Button>
<Button type="submit">Create Org</Button>
</form>
);
}
2 changes: 1 addition & 1 deletion app/[org]/_components/CreateProjectForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function CreateProjectForm({ orgSlug }: { orgSlug: string }) {
name="projectName"
placeholder="Studio"
/>
<Button>Create project</Button>
<Button type="submit">Create project</Button>
</form>
);
}
8 changes: 6 additions & 2 deletions components/Button.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
type ButtonProps = {
children: React.ReactNode;
type?: 'button' | 'submit' | 'reset';
};

export default function Button({ children }: ButtonProps) {
export default function Button({ children, type = 'button' }: ButtonProps) {
return (
<button className="mb-2 me-2 w-36 rounded-lg bg-slate-900 px-5 py-2.5 text-sm font-medium text-white">
<button
type={type}
className="mb-2 me-2 w-36 rounded-lg bg-slate-900 px-5 py-2.5 text-sm font-medium text-white"
>
{children}
</button>
);
Expand Down

0 comments on commit 5063f9b

Please sign in to comment.