-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
wkim10
committed
Oct 10, 2024
1 parent
b40eb39
commit 80829d8
Showing
2 changed files
with
31 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,27 +1,12 @@ | ||
"use client"; | ||
|
||
import { addUser } from "./api/user/route.client"; | ||
import ExampleButton from "@/components/ExampleButton"; | ||
|
||
export default function Home() { | ||
return ( | ||
<div className="flex items-center justify-center h-screen"> | ||
{/* Test Button */} | ||
<button | ||
className="bg-slate-700 text-white p-4 rounded-full" | ||
onClick={async () => { | ||
const response = await addUser({ | ||
body: { | ||
user: { | ||
firstName: "Johnny", | ||
email: "[email protected]", | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
}} | ||
> | ||
Add User | ||
</button> | ||
{/* Example Button (ExampleButton.tsx in components folder) */} | ||
<ExampleButton buttonText="Add User" /> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { addUser } from "@/app/api/user/route.client"; | ||
|
||
interface ExampleButtonProps { | ||
buttonText: string; | ||
} | ||
|
||
const ExampleButton = ({ buttonText }: ExampleButtonProps) => { | ||
return ( | ||
<button | ||
className="bg-slate-700 text-white p-4 rounded-full" | ||
onClick={async () => { | ||
const response = await addUser({ | ||
body: { | ||
user: { | ||
firstName: "Johnny", | ||
email: "[email protected]", | ||
}, | ||
}, | ||
}); | ||
console.log(response); | ||
}} | ||
> | ||
{buttonText} | ||
</button> | ||
); | ||
}; | ||
|
||
export default ExampleButton; |