-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into nova-leaderboards
- Loading branch information
Showing
139 changed files
with
6,947 additions
and
657 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
import Layout from "../../src/components/layout/layout"; | ||
import PracticeSelect from "../../src/components/practice/PracticeSelect"; | ||
import AtBatView from "../../src/components/atbat/AtBatView"; | ||
|
||
const Home = () => { | ||
return ( | ||
<Layout home={true} title="Fullcount"> | ||
<AtBatView /> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Home; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import Layout from "../../src/components/layout/layout"; | ||
import PracticeSelect from "../../src/components/practice/PracticeSelect"; | ||
|
||
const Home = () => { | ||
return ( | ||
<Layout home={true} title="Fullcount"> | ||
<PracticeSelect /> | ||
</Layout> | ||
); | ||
}; | ||
|
||
export default Home; |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
NEXT_PUBLIC_HUMBUG_TOKEN=<HUMBUG_TOKEN>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,65 @@ | ||
import styles from "./AtBatsList.module.css"; | ||
import { AtBat, OwnedToken, Token } from "../../types"; | ||
import TokenToPlay from "./TokenToPlay"; | ||
import DotsCounter from "../sessions/DotsCounter"; | ||
|
||
export const outcomes = [ | ||
"In Progress", | ||
"Strikeout", | ||
"Walk", | ||
"Single", | ||
"Double", | ||
"Triple", | ||
"Home Run", | ||
"In Play Out", | ||
]; | ||
|
||
export const outcomeType = (tokens: Token[], atBat: AtBat): "positive" | "negative" | undefined => { | ||
const { pitcher, batter } = atBat; | ||
if (tokens.some((t) => t.address === pitcher?.address && t.id === pitcher.id)) { | ||
return atBat.outcome === 1 || atBat.outcome === 7 ? "positive" : "negative"; | ||
} | ||
if (tokens.some((t) => t.address === batter?.address && t.id === batter.id)) { | ||
return atBat.outcome === 1 || atBat.outcome === 7 ? "negative" : "positive"; | ||
} | ||
}; | ||
|
||
const AtBatItem = ({ atBat, tokens }: { atBat: AtBat; tokens: OwnedToken[] }) => { | ||
return ( | ||
<div className={styles.atBatContainer}> | ||
<div className={styles.cards}> | ||
{atBat.pitcher ? ( | ||
<TokenToPlay token={atBat.pitcher} isPitcher={true} /> | ||
) : ( | ||
<div style={{ width: "100px", height: "152px", border: "1px solid #7E8E7F" }} /> | ||
)} | ||
<div className={styles.vs}>VS</div> | ||
{atBat.batter ? ( | ||
<TokenToPlay token={atBat.batter} isPitcher={false} /> | ||
) : ( | ||
<div style={{ width: "100px", height: "152px", border: "1px solid #7E8E7F" }} /> | ||
)} | ||
</div> | ||
{atBat.outcome !== 0 ? ( | ||
<div | ||
className={ | ||
!outcomeType(tokens, atBat) | ||
? styles.othersOutcome | ||
: outcomeType(tokens, atBat) === "positive" | ||
? styles.positiveOutcome | ||
: styles.negativeOutcome | ||
} | ||
> | ||
{outcomes[atBat.outcome]}! | ||
</div> | ||
) : ( | ||
<div className={styles.activeAtBat}> | ||
<DotsCounter label={"BALL"} count={atBat.balls} capacity={4} /> | ||
<DotsCounter label={"STRIKE"} count={atBat.strikes} capacity={3} /> | ||
</div> | ||
)} | ||
</div> | ||
); | ||
}; | ||
|
||
export default AtBatItem; |
Oops, something went wrong.