Skip to content

Commit

Permalink
feat(examples) interoperable tictactoe frontend (#182)
Browse files Browse the repository at this point in the history
* tictactoe frontend

* ignore tsbuildinfo

* seperate board & game
  • Loading branch information
hamdiallam authored Oct 16, 2024
1 parent d642dd4 commit 54e452c
Show file tree
Hide file tree
Showing 39 changed files with 12,069 additions and 0 deletions.
28 changes: 28 additions & 0 deletions examples/tictactoe/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

# vite / ts
.vite
*.tsbuildinfo
11 changes: 11 additions & 0 deletions examples/tictactoe/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# TicTacToe

A simple tic-tac-toe game built with React, Wagmi, and Supersim.

## Overview

This project is a simple tic-tac-toe game that allows two players to play against each other on the Ethereum blockchain using Supersim. The game is built with React, Wagmi, and Supersim.

## Getting Started

TODO
28 changes: 28 additions & 0 deletions examples/tictactoe/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import js from '@eslint/js'
import globals from 'globals'
import reactHooks from 'eslint-plugin-react-hooks'
import reactRefresh from 'eslint-plugin-react-refresh'
import tseslint from 'typescript-eslint'

export default tseslint.config(
{ ignores: ['dist'] },
{
extends: [js.configs.recommended, ...tseslint.configs.recommended],
files: ['**/*.{ts,tsx}'],
languageOptions: {
ecmaVersion: 2020,
globals: globals.browser,
},
plugins: {
'react-hooks': reactHooks,
'react-refresh': reactRefresh,
},
rules: {
...reactHooks.configs.recommended.rules,
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
},
)
13 changes: 13 additions & 0 deletions examples/tictactoe/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Tic Tac Toe</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="/src/main.tsx"></script>
</body>
</html>
35 changes: 35 additions & 0 deletions examples/tictactoe/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "tictactoe",
"private": true,
"version": "0.0.0",
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc -b && vite build",
"lint": "eslint .",
"preview": "vite preview"
},
"dependencies": {
"@eth-optimism/viem": "^0.0.7",
"@eth-optimism/wagmi": "^0.0.7",
"@rainbow-me/rainbowkit": "^2.2.0",
"@tanstack/react-query": "^5.59.14",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"viem": "^2.21.26",
"wagmi": "^2.12.17"
},
"devDependencies": {
"@eslint/js": "^9.12.0",
"@types/react": "^18.3.11",
"@types/react-dom": "^18.3.1",
"@vitejs/plugin-react": "^4.3.2",
"eslint": "^9.12.0",
"eslint-plugin-react-hooks": "5.1.0-rc-fb9a90fa48-20240614",
"eslint-plugin-react-refresh": "^0.4.12",
"globals": "^15.11.0",
"typescript": "^5.6.3",
"typescript-eslint": "^8.9.0",
"vite": "^5.4.9"
}
}
Loading

0 comments on commit 54e452c

Please sign in to comment.