From 5d1222df96c50eee49218ff852b151bcb222b167 Mon Sep 17 00:00:00 2001 From: Hiroki Okui Date: Tue, 12 Dec 2023 16:53:14 +0900 Subject: [PATCH 1/2] fix: Show dummy img when avatarUrl is dummy.png --- src/components/Page2.tsx | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/Page2.tsx b/src/components/Page2.tsx index dba2a7b..64d8f2b 100644 --- a/src/components/Page2.tsx +++ b/src/components/Page2.tsx @@ -77,7 +77,8 @@ function Track({ talk, track, speakers }: TrackProps) { return <> } const companies = new Set(speakers.map((s) => s.company)) - const avatarUrl = speakers[0].avatarUrl || '/cndt2023/trademark.png' + const re = /https:\/\/.*/ + const avatarUrl = re.test(speakers[0].avatarUrl || '') ? speakers[0].avatarUrl! : '/cndt2023/trademark.png' return (
From 387343f22faef07dcde3856ca98cfce581945cff Mon Sep 17 00:00:00 2001 From: Hiroki Okui Date: Tue, 12 Dec 2023 16:55:24 +0900 Subject: [PATCH 2/2] run fmt --- src/components/Page2.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/Page2.tsx b/src/components/Page2.tsx index 64d8f2b..10a0e15 100644 --- a/src/components/Page2.tsx +++ b/src/components/Page2.tsx @@ -78,7 +78,9 @@ function Track({ talk, track, speakers }: TrackProps) { } const companies = new Set(speakers.map((s) => s.company)) const re = /https:\/\/.*/ - const avatarUrl = re.test(speakers[0].avatarUrl || '') ? speakers[0].avatarUrl! : '/cndt2023/trademark.png' + const avatarUrl = re.test(speakers[0].avatarUrl || '') + ? speakers[0].avatarUrl! + : '/cndt2023/trademark.png' return (