From 7d02c904021cfb4a67ff4d76b4b9e89c851a048f Mon Sep 17 00:00:00 2001 From: Shusaku Uesugi Date: Tue, 14 Jan 2025 10:38:58 -0800 Subject: [PATCH 1/2] Move files --- .../app/{helpful-links/page.tsx => helpful-links.tsx} | 0 .../app/{smaller-triangle/page.tsx => smaller-triangle.tsx} | 0 vercel-tutor/steps.json | 6 +++--- 3 files changed, 3 insertions(+), 3 deletions(-) rename vercel-tutor/app/{helpful-links/page.tsx => helpful-links.tsx} (100%) rename vercel-tutor/app/{smaller-triangle/page.tsx => smaller-triangle.tsx} (100%) diff --git a/vercel-tutor/app/helpful-links/page.tsx b/vercel-tutor/app/helpful-links.tsx similarity index 100% rename from vercel-tutor/app/helpful-links/page.tsx rename to vercel-tutor/app/helpful-links.tsx diff --git a/vercel-tutor/app/smaller-triangle/page.tsx b/vercel-tutor/app/smaller-triangle.tsx similarity index 100% rename from vercel-tutor/app/smaller-triangle/page.tsx rename to vercel-tutor/app/smaller-triangle.tsx diff --git a/vercel-tutor/steps.json b/vercel-tutor/steps.json index 173467af71..1678460a2e 100644 --- a/vercel-tutor/steps.json +++ b/vercel-tutor/steps.json @@ -6,7 +6,7 @@ "branchName": "main" }, "target": { - "templatePath": "app/smaller-triangle/page.tsx", + "templatePath": "app/smaller-triangle.tsx", "branchName": "vercel-bot-patch" }, "path": "app/page.tsx", @@ -17,11 +17,11 @@ "helpful-links": { "type": "commit-merge-comment", "base": { - "templatePath": "app/smaller-triangle/page.tsx", + "templatePath": "app/smaller-triangle.tsx", "branchName": "vercel-bot-patch" }, "target": { - "templatePath": "app/helpful-links/page.tsx", + "templatePath": "app/helpful-links.tsx", "branchName": "vercel-bot-patch" }, "path": "app/page.tsx", From 0244c11bf9e2a4f8efbfb40f78b45c0fe2382d16 Mon Sep 17 00:00:00 2001 From: Shusaku Uesugi Date: Tue, 14 Jan 2025 10:47:49 -0800 Subject: [PATCH 2/2] Add loading state --- vercel-tutor/app/page.tsx | 10 +++++++++- vercel-tutor/app/smaller-triangle.tsx | 10 +++++++++- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/vercel-tutor/app/page.tsx b/vercel-tutor/app/page.tsx index a1af4890ef..cdef4d748c 100644 --- a/vercel-tutor/app/page.tsx +++ b/vercel-tutor/app/page.tsx @@ -27,6 +27,7 @@ function Circle() { export default function Home() { const [nextUrl, setNextUrl] = useState("#"); + const [isLoading, setIsLoading] = useState(false); useEffect(() => { const host = window.location.hostname; @@ -74,8 +75,15 @@ export default function Home() { { + if (isLoading) { + e.preventDefault(); + } else { + setIsLoading(true); + } + }} > - View Pull Request + {isLoading ? 'Loading…' : 'View Pull Request'} { const host = window.location.hostname; @@ -119,8 +120,15 @@ export default function Home() { { + if (isLoading) { + e.preventDefault(); + } else { + setIsLoading(true); + } + }} > - Push Commit and Merge Pull Request + {isLoading ? 'Loading…' : 'Push Commit and Merge Pull Request'}