Skip to content

Commit

Permalink
Merge branch 'default-settings-to-current-difficulty'
Browse files Browse the repository at this point in the history
  • Loading branch information
pishposh committed Nov 7, 2024
2 parents c99b1de + 7811f44 commit fc4abf2
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 22 deletions.
39 changes: 19 additions & 20 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,32 +54,31 @@ function App() {
return (
<>
<Header>
<span
className="link-alike"
onClick={() => setInfoDialogOpen(!infoDialogOpen)}
>
<a href="https://nytimesguild.org/tech/guild-builds/">
More Games
</a>

<span className="link-alike" onClick={() => setInfoDialogOpen(!infoDialogOpen)}>
What’s this?
</span>
{infoDialogOpen && (
<InfoDialog onClose={() => setInfoDialogOpen(false)} />
)}

<a style={{cursor: "pointer"}} onClick={() => setGameSettingsOpen(!gameSettingsOpen)}>
<span className="link-alike" onClick={() => setGameSettingsOpen(!gameSettingsOpen)}>
Settings
</a>
</span>
{gameSettingsOpen && (
<GameSettings
onClose={() => setGameSettingsOpen(false)}
onSave={(difficulty) => {
setGame(game.resetWithDifficulty(difficulty));
}}
currentDifficulty={game.getDifficulty()}
/>
)}
</Header>

{infoDialogOpen && (
<InfoDialog onClose={() => setInfoDialogOpen(false)} />
)}

{gameSettingsOpen && (
<GameSettings
onClose={() => setGameSettingsOpen(false)}
onSave={(difficulty) => {
setGame(game.resetWithDifficulty(difficulty));
}}
currentDifficulty={game.getDifficulty()}
/>
)}

<div id="game-container">
<div id="game">
{game.getCards().map((card) => (
Expand Down
2 changes: 1 addition & 1 deletion src/components/Header/Header.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

> div.header-links {
justify-content: end;
& > * {
& > a, & > .link-alike {
margin-left: 1rem;
}
}
Expand Down
1 change: 0 additions & 1 deletion src/components/Header/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ export const Header = ({ children }: PropsWithChildren) => (
<b>Match Strike</b>
</div>
<div className="header-links">
<a href="https://nytimesguild.org/tech/guild-builds/">More Games</a>
{children}
</div>
</div>
Expand Down

0 comments on commit fc4abf2

Please sign in to comment.