-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(examples) interoperable tictactoe frontend #182
Conversation
Deploying supersim with Cloudflare Pages
|
This stack of pull requests is managed by Graphite. Learn more about stacking. Join @hamdiallam and the rest of your teammates on Graphite |
d083ddf
to
ea8442d
Compare
0e74032
to
9058b4a
Compare
9d2de09
to
66a6713
Compare
9058b4a
to
c344f95
Compare
66a6713
to
4ddbcc1
Compare
7e25673
to
fffa1a9
Compare
fffa1a9
to
ca082e9
Compare
2fda160
to
44317a8
Compare
@@ -0,0 +1 @@ | |||
{"root":["./src/app.tsx","./src/main.tsx","./src/vite-env.d.ts","./src/components/board.tsx","./src/components/connectwallet.tsx","./src/components/gamelists.tsx","./src/components/newgame.tsx","./src/components/square.tsx","./src/constants/chains.ts","./src/constants/tictactoe.ts","./src/hooks/useacceptgame.ts","./src/hooks/usegames.ts","./src/hooks/usemakemove.ts","./src/hooks/usenewgame.ts","./src/hooks/useplayergames.ts","./src/types/game.ts"],"errors":true,"version":"5.6.2"} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can gitignore this and the node tsbuildinfo files https://github.com/ethereum-optimism/ecosystem/blob/acfd4b41e800214c5e56b3a408970c14c32eb332/.gitignore#L13C1-L13C24
games: Game[] | ||
} | ||
|
||
const AvailableGames: React.FC<AvailableGamesProps> = ({ games }) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can also write the above like below to help with how verbose it can get and not have to deal with React changing it's types like it does sometimes. wouldn't actually change anything on this PR just adding a comment for learning
const AvailableGames = ({ games }: AvailableGamesProps)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ahh nice didn't know that
const cellBackgroundColor = (row: number, col: number) => { | ||
if (!gameEndingMoves) { return '#F2F3F8' } | ||
|
||
const move = game.moves[row][col] | ||
|
||
// winning cell | ||
if (move == 1 && gameEndingMoves.some(move => move[0] === row && move[1] === col)) { return '#D6FFDA' } | ||
|
||
// losing cell | ||
if (move == 2 && gameEndingMoves.some(move => move[0] === row && move[1] === col)) { return '#FFD6D6' } | ||
|
||
return '#F2F3F8' | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it would be better to do this type of logic with classnames
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
agreed, this will be apart of the cleanup
For the styles i think we can move this over to tailwind once it gets merged in will make the styling and logic around it much cleaner |
4ddbcc1
to
418ca2e
Compare
44317a8
to
e08030f
Compare
e08030f
to
b21eea3
Compare
/contracts/scripts/tictactoe/Deploy
to each L2 chainTODO: