Skip to content
This repository has been archived by the owner on Dec 25, 2024. It is now read-only.

Commit

Permalink
Refactor mypage component and transaction table
Browse files Browse the repository at this point in the history
  • Loading branch information
walnuts1018 committed Nov 5, 2023
1 parent 3668baf commit 8aacc53
Show file tree
Hide file tree
Showing 7 changed files with 512 additions and 459 deletions.
3 changes: 2 additions & 1 deletion front/src/app/[userid]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { MypageComponent } from "../mypage/MypageComponent";
export default function Page({ params }: { params: { userid: string } }) {
return <div>My Post: {params.userid}</div>;
return <MypageComponent userID={params.userid} />;
}
6 changes: 4 additions & 2 deletions front/src/app/mypage/AddButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export function AddButton({
new Date().toISOString().split("T")[0]
);
const [transactionTitle, setTransactionTitle] = useState("");
const [transactionAmount, setTransactionAmount] = useState(0);
const [transactionAmount, setTransactionAmount] = useState("");

useEffect(() => {
if (inputEl.current) {
Expand All @@ -42,6 +42,8 @@ export function AddButton({
if (res.ok) {
const data = await res.json();
console.log(data);
setTransactionTitle("");
setTransactionAmount("");
}
}
}
Expand Down Expand Up @@ -125,7 +127,7 @@ export function AddButton({
}}
value={transactionAmount}
onChange={(e) => {
setTransactionAmount(Number(e.target.value));
setTransactionAmount(e.target.value);
}}
placeholder="金額"
/>
Expand Down
Loading

0 comments on commit 8aacc53

Please sign in to comment.