From 15accbed92dbc407eae903d96894f655fe6aac77 Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Tue, 7 May 2024 12:06:29 +0300 Subject: [PATCH 1/7] new token id for demo --- web/src/components/atbat/OnboardingAPI.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/components/atbat/OnboardingAPI.ts b/web/src/components/atbat/OnboardingAPI.ts index b5e4eafc..01cb7773 100644 --- a/web/src/components/atbat/OnboardingAPI.ts +++ b/web/src/components/atbat/OnboardingAPI.ts @@ -2,7 +2,7 @@ import { AtBatStatus, BatterReveal, PitcherReveal, SessionStatus } from "../../t export const selectedToken = { address: "0xf40c0961A9CC5c037B92D2cb48167F7f62Dd7cD0", - id: "2", + id: "155", image: "https://static.fullcount.xyz/Beer_League_Ballers/p2.png", isStaked: true, stakedSessionID: 0, From 4cb49b134b217c4b30457a074576d11caf704afa Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Tue, 7 May 2024 12:07:11 +0300 Subject: [PATCH 2/7] fix queries dependencies --- web/src/components/atbat/TokenCard.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/web/src/components/atbat/TokenCard.tsx b/web/src/components/atbat/TokenCard.tsx index 0de6f5d4..291538b4 100644 --- a/web/src/components/atbat/TokenCard.tsx +++ b/web/src/components/atbat/TokenCard.tsx @@ -11,7 +11,7 @@ import DetailedStat from "../playing/DetailedStat"; const TokenCard = ({ token, isPitcher }: { token: Token; isPitcher: boolean }) => { const pitcherStats = useQuery( - ["pitcher_stat", token], + ["pitcher_stat", token.id], async () => { if (!token) { return; @@ -36,7 +36,7 @@ const TokenCard = ({ token, isPitcher }: { token: Token; isPitcher: boolean }) = ); const batterStats = useQuery( - ["batter_stat", token], + ["batter_stat", token.id], async () => { if (!token) { return; @@ -61,7 +61,7 @@ const TokenCard = ({ token, isPitcher }: { token: Token; isPitcher: boolean }) = ); const pitchDistributions = useQuery( - ["pitch_distribution", token], + ["pitch_distribution", token.id], async () => { if (!token) { return; @@ -98,7 +98,7 @@ const TokenCard = ({ token, isPitcher }: { token: Token; isPitcher: boolean }) = ); const swingDistributions = useQuery( - ["swing_distribution", token], + ["swing_distribution", token.id], async () => { if (!token) { return; From f6928d6b22f94f3665488e29ebec1efbbe63cf66 Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Tue, 7 May 2024 12:07:51 +0300 Subject: [PATCH 3/7] NUMBER_OF_BLB_IMAGES constant --- web/src/components/atbat/OnboardingCharacter.tsx | 5 ++--- web/src/components/tokens/CreateCharacterForm.tsx | 5 ++--- web/src/constants.ts | 2 ++ 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/web/src/components/atbat/OnboardingCharacter.tsx b/web/src/components/atbat/OnboardingCharacter.tsx index 00f5565e..8b94bbbc 100644 --- a/web/src/components/atbat/OnboardingCharacter.tsx +++ b/web/src/components/atbat/OnboardingCharacter.tsx @@ -3,9 +3,8 @@ import Image from "next/image"; import styles from "../tokens/CreateNewCharacter.module.css"; import localStyles from "./OnboardingCharacter.module.css"; import React, { useEffect, useState } from "react"; -import { blbImage } from "../../constants"; +import { blbImage, NUMBER_OF_BLB_IMAGES } from "../../constants"; import { useSound } from "../../hooks/useSound"; -const NUMBER_OF_IMAGES = 8; const names = [ "Joe Expo", "Playtest Celeste", @@ -18,7 +17,7 @@ const names = [ ]; const images: number[] = []; -for (let i = 0; i < NUMBER_OF_IMAGES; i += 1) { +for (let i = 0; i < NUMBER_OF_BLB_IMAGES; i += 1) { images.push(i); } diff --git a/web/src/components/tokens/CreateCharacterForm.tsx b/web/src/components/tokens/CreateCharacterForm.tsx index d86a76b6..3eb6aaa2 100644 --- a/web/src/components/tokens/CreateCharacterForm.tsx +++ b/web/src/components/tokens/CreateCharacterForm.tsx @@ -7,13 +7,12 @@ import { TokenSource } from "../../types"; import { useMutation, useQueryClient } from "react-query"; import { mintFullcountPlayerToken } from "../../tokenInterfaces/FullcountPlayerAPI"; import useMoonToast from "../../hooks/useMoonToast"; -import { blbImage } from "../../constants"; +import { blbImage, NUMBER_OF_BLB_IMAGES } from "../../constants"; import { sendReport } from "../../utils/humbug"; import { useSound } from "../../hooks/useSound"; -const NUMBER_OF_IMAGES = 8; const images: number[] = []; -for (let i = 0; i < NUMBER_OF_IMAGES; i += 1) { +for (let i = 0; i < NUMBER_OF_BLB_IMAGES; i += 1) { images.push(i); } diff --git a/web/src/constants.ts b/web/src/constants.ts index 6b61b3f9..60dfb2f4 100644 --- a/web/src/constants.ts +++ b/web/src/constants.ts @@ -92,4 +92,6 @@ export const LEADERBOARDS = [ export const blbImage = (idx: number) => `https://static.fullcount.xyz/Beer_League_Ballers/small/p${idx}.jpeg`; + +export const NUMBER_OF_BLB_IMAGES = 16; export const HUMBUG_REPORT_VERSION = "0.0.3"; From 5fa3149af89d0f06a152d092833a71b8550493f0 Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Tue, 7 May 2024 18:34:54 +0300 Subject: [PATCH 4/7] hide player view while character to select --- web/src/components/atbat/AtBatView2.tsx | 195 ++++++++++++------------ 1 file changed, 99 insertions(+), 96 deletions(-) diff --git a/web/src/components/atbat/AtBatView2.tsx b/web/src/components/atbat/AtBatView2.tsx index 0c11094b..5145de3d 100644 --- a/web/src/components/atbat/AtBatView2.tsx +++ b/web/src/components/atbat/AtBatView2.tsx @@ -83,7 +83,7 @@ const AtBatView2: React.FC = () => { className={styles.container} style={{ maxHeight: windowHeight ? `${windowHeight}px` : "100vh" }} > - {isCharacterSelectOpen && ( + {isCharacterSelectOpen ? ( setIsCharacterSelectOpen(false)} onChange={(name, image) => { @@ -91,107 +91,110 @@ const AtBatView2: React.FC = () => { setImage(image); }} /> - )} - {""} - {atBat && showPitchOutcome && atBat.outcome !== 0 && atBat.pitches.length > 0 && ( -
{ - playSound("homeButton"); - updateContext({ isLaunching: false }); - router.push("/"); - }} - > - JOIN FULLCOUNT -
- )} + ) : ( + <> + {""} + {atBat && showPitchOutcome && atBat.outcome !== 0 && atBat.pitches.length > 0 && ( +
{ + playSound("homeButton"); + updateContext({ isLaunching: false }); + router.push("/"); + }} + > + JOIN FULLCOUNT +
+ )} - {!isBigView && } - {isBigView && atBat.outcome === 0 && !showPitchOutcome && ( - - )} - {atBat && - showPitchOutcome && - atBat.pitches.length > 0 && - selectedToken && - atBat.outcome === 0 && ( -
- {sessionOutcomes[atBat.pitches[atBat.numberOfSessions - 2].outcome]}! -
- )} - {atBat.outcome !== 0 && selectedToken && ( -
- {outcomeType([selectedToken], atBat) === "positive" ? "you win!" : "you lose!"} -
- )} - {atBat.outcome === 0 && - !showPitchOutcome && - atBat.pitches[atBat.numberOfSessions - 1].progress !== 2 && - atBat.pitches[currentSessionIdx].progress !== 6 && ( -
- {isBigView && atBat.pitcher && } - {selectedToken && isSameToken(selectedToken, atBat.pitcher) && ( - - )} - {selectedToken && isSameToken(selectedToken, atBat.batter) && ( - + {!isBigView && } + {isBigView && atBat.outcome === 0 && !showPitchOutcome && ( + + )} + {atBat && + showPitchOutcome && + atBat.pitches.length > 0 && + selectedToken && + atBat.outcome === 0 && ( +
+ {sessionOutcomes[atBat.pitches[atBat.numberOfSessions - 2].outcome]}! +
)} - {isBigView && atBat.batter && } -
- )} - {atBat && showPitchOutcome && atBat.pitches.length > 0 && ( - <> - {atBat && ( - + > + {outcomeType([selectedToken], atBat) === "positive" ? "you win!" : "you lose!"} + + )} + {atBat.outcome === 0 && + !showPitchOutcome && + atBat.pitches[atBat.numberOfSessions - 1].progress !== 2 && + atBat.pitches[currentSessionIdx].progress !== 6 && ( +
+ {isBigView && atBat.pitcher && } + {selectedToken && isSameToken(selectedToken, atBat.pitcher) && ( + + )} + {selectedToken && isSameToken(selectedToken, atBat.batter) && ( + + )} + {isBigView && atBat.batter && } +
+ )} + {atBat && showPitchOutcome && atBat.pitches.length > 0 && ( + <> + {atBat && ( + + )} + )} + {!showPitchOutcome && !isBigView && } )} - {!showPitchOutcome && !isBigView && } ); }; From 194ba0f423900d6e31a7fad55395421e938ebe8a Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Tue, 7 May 2024 18:35:42 +0300 Subject: [PATCH 5/7] fix iPhone 12 pro outcome view --- web/src/components/atbat/Outcome2.module.css | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/web/src/components/atbat/Outcome2.module.css b/web/src/components/atbat/Outcome2.module.css index ea103fe6..a7633cdf 100644 --- a/web/src/components/atbat/Outcome2.module.css +++ b/web/src/components/atbat/Outcome2.module.css @@ -54,7 +54,7 @@ display: flex; flex-direction: column; align-items: center; - max-width: 80px; + max-width: 50px; } .actionType { @@ -128,6 +128,12 @@ color: #CD7676; } +@media (min-width: 440px) { + .imageContainer { + max-width: 80px; + } +} + @media (min-width: 1024px) { .positiveOutcome, .negativeOutcome { font-size: 30px; From 5af065697c1a8ad8c902317c967fe5b51634c360 Mon Sep 17 00:00:00 2001 From: Anton Mushnin Date: Tue, 7 May 2024 18:36:14 +0300 Subject: [PATCH 6/7] using 8 portraits for onboarding --- web/src/components/atbat/OnboardingCharacter.tsx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/web/src/components/atbat/OnboardingCharacter.tsx b/web/src/components/atbat/OnboardingCharacter.tsx index 8b94bbbc..d3b549c9 100644 --- a/web/src/components/atbat/OnboardingCharacter.tsx +++ b/web/src/components/atbat/OnboardingCharacter.tsx @@ -3,7 +3,7 @@ import Image from "next/image"; import styles from "../tokens/CreateNewCharacter.module.css"; import localStyles from "./OnboardingCharacter.module.css"; import React, { useEffect, useState } from "react"; -import { blbImage, NUMBER_OF_BLB_IMAGES } from "../../constants"; +import { blbImage } from "../../constants"; import { useSound } from "../../hooks/useSound"; const names = [ "Joe Expo", @@ -16,11 +16,6 @@ const names = [ "Drew Preview", ]; -const images: number[] = []; -for (let i = 0; i < NUMBER_OF_BLB_IMAGES; i += 1) { - images.push(i); -} - const OnboardingCharacter = ({ onClose, onChange, @@ -52,7 +47,7 @@ const OnboardingCharacter = ({ {""}
{names[imageIndex]}
- {images.map((_, idx: number) => ( + {names.map((_, idx: number) => ( Date: Tue, 7 May 2024 18:36:39 +0300 Subject: [PATCH 7/7] adding privacy policy link --- web/src/components/LaunchForm.module.css | 11 +++++++++++ web/src/components/LaunchForm.tsx | 3 +++ 2 files changed, 14 insertions(+) diff --git a/web/src/components/LaunchForm.module.css b/web/src/components/LaunchForm.module.css index a5bfb133..2c5c68db 100644 --- a/web/src/components/LaunchForm.module.css +++ b/web/src/components/LaunchForm.module.css @@ -120,3 +120,14 @@ .button { cursor: pointer; } + +.legalText { + color: #262019; + font-size: 14px; + font-style: normal; + font-weight: 400; + line-height: normal; + cursor: pointer; + margin-top: -5px; + margin-bottom: -5px; +} diff --git a/web/src/components/LaunchForm.tsx b/web/src/components/LaunchForm.tsx index 73e78792..5715dbe3 100644 --- a/web/src/components/LaunchForm.tsx +++ b/web/src/components/LaunchForm.tsx @@ -77,6 +77,9 @@ const LaunchForm = ({ onClose }: { onClose: () => void }) => { />
+ +
Privacy Policy
+
); };