Skip to content

Commit 868f4ea

Browse files
authored
Merge pull request #104 from kc3hack/FE-79
Fe 79
2 parents 066f6aa + 13273de commit 868f4ea

File tree

4 files changed

+38
-18
lines changed

4 files changed

+38
-18
lines changed

frontend/public/chaShibaki.gif

638 KB
Loading

frontend/src/Result/Components/ResultButtons.tsx

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -85,12 +85,23 @@ export default function ResultButtons({
8585
"color 0.2s ease, border-color 0.2s ease, background-color 0.2s ease",
8686
}}
8787
>
88-
{isBookmarked ? (
89-
<FavoriteIcon fontSize="medium" />
88+
{isAnimating ? (
89+
<img
90+
src={`/chaShibaki.gif?t=${Date.now()}`}
91+
alt="ええやん"
92+
style={{ width: "40px", height: "40px", objectFit: "contain" }}
93+
/>
9094
) : (
91-
<FavoriteBorderIcon fontSize="medium" />
92-
)}
93-
<span>ええやん</span>
95+
<img
96+
src="/chashibaki.png"
97+
alt="ちゃしばき済"
98+
style={{ width: "40px", height: "40px", objectFit: "contain" }}
99+
/>
100+
)}
101+
<span>
102+
ええやん
103+
</span>
104+
94105
</Button>
95106

96107
<Button

frontend/src/Result/Components/ResultOverlay.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ export default function ResultOverlay({
3232
const handleShare = () => setIsShareOpen(true);
3333
const handleBookmarkAndShare = () => {
3434
onBookmark();
35-
handleShare();
35+
// handleShare();
3636
};
3737

3838
return (
39-
<button
39+
<div
4040
className="overlay"
4141
onClick={onClose}
4242
onKeyDown={(e) => e.key === "Escape" && onClose}
43-
type="button"
43+
// type="button"
4444
tabIndex={0}
4545
>
4646
{!isGivenUp && <ThanksConfetti />}
@@ -78,6 +78,6 @@ export default function ResultOverlay({
7878
{isShareOpen && (
7979
<ShareModal gameId={gameId} onClose={() => setIsShareOpen(false)} />
8080
)}
81-
</button>
81+
</div>
8282
);
8383
}

frontend/src/Solo/index.tsx

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -251,18 +251,26 @@ function Solo() {
251251
if (!isBookmarked) {
252252
setIsAnimating(true);
253253
setIsBookmarked(true);
254-
try {
255-
await fetch(`/api/solo/${gameId ?? 0}/bookmark`, { method: "POST" });
256-
} catch (e) {
257-
console.error("ブックマーク登録に失敗しました:", e);
258-
setIsBookmarked(false);
259-
}
260-
setTimeout(() => setIsAnimating(false), 600);
254+
const postBookmark = async () => {
255+
try {
256+
const res = await fetch(`/api/solo/${gameId ?? 0}/bookmark`, { method: "POST" });
257+
if (!res.ok) throw new Error("通信エラー");
258+
} catch (e) {
259+
console.error("ブックマーク登録に失敗しました:", e);
260+
setIsBookmarked(false);
261+
}
262+
};
263+
setTimeout(() => {
264+
setIsAnimating(false);
265+
postBookmark();
266+
handleShare();
267+
268+
}, 2000);
261269
}
262270
};
263271
const handleBookmarkAndShare = async () => {
264272
await handleBookmark();
265-
handleShare();
273+
// handleShare();
266274
};
267275

268276
const handleCloseResult = () => {
@@ -421,7 +429,8 @@ function Solo() {
421429
isAnimating={isAnimating}
422430
onBackToTitle={handleTitle}
423431
onRetry={handleRetry}
424-
onBookmark={handleBookmarkAndShare}
432+
// onBookmark={handleBookmarkAndShare}
433+
onBookmark={handleBookmark}
425434
/>
426435
</div>
427436
)}

0 commit comments

Comments
 (0)