Skip to content
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

fix: proposal list box and PX #9

Open
wants to merge 98 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
98 commits
Select commit Hold shift + click to select a range
903cc4c
chore: add in governance
mariz-ov Jun 21, 2024
0ad6430
fix: add some modules
0xshora Jun 21, 2024
f939f3b
chore: update color picker
0xshora Jun 21, 2024
fd134b2
chore: update color picker
0xshora Jun 21, 2024
9b8f603
bug: shows dirrent colors
0xshora Jun 21, 2024
2c65aff
feat: can paint with p_war.interact
0xshora Jun 21, 2024
971e9c4
Merge pull request #6 from pixelaw/dev/shora
0xshora Jun 21, 2024
d7bedd5
feat: add a close button for a color palette
0xshora Jun 21, 2024
bcf571e
Merge pull request #7 from pixelaw/dev/shora
0xshora Jun 22, 2024
9712f8b
Merge branch 'main' into sync/pixelaw-web
0xshora Jun 24, 2024
8296eac
Merge pull request #8 from pixelaw/sync/pixelaw-web
0xshora Jun 24, 2024
7e966b6
fix: adjust client sides for new contracts
0xshora Jun 24, 2024
a961f10
fix: adjust client sides for new contracts
0xshora Jun 24, 2024
1f2891c
Merge pull request #9 from pixelaw/feat/update-UIUX
0xshora Jun 24, 2024
ccad61b
fix: color appearance by deleting alpha channel
0xshora Jun 24, 2024
019d67c
Merge pull request #10 from pixelaw/feat/update-UIUX
0xshora Jun 24, 2024
a59bcce
feat: complete entire cycle
mariz-ov Jun 24, 2024
02f94c7
Merge remote-tracking branch 'origin/main'
mariz-ov Jun 24, 2024
8848146
fix: make disaster color
mariz-ov Jun 24, 2024
357592d
fix: incorrect color being pushed
mariz-ov Jun 24, 2024
713227b
chore: make proposal time reactive
mariz-ov Jun 24, 2024
b99ca86
chore: add dependencies to useEffect
mariz-ov Jun 24, 2024
92a3ac1
fix: cannot filter by search term
mariz-ov Jun 24, 2024
a522464
fix: errors about hexRGBtoNumber
0xshora Jun 24, 2024
db6f76b
Merge pull request #11 from pixelaw/feat/update-UIUX-shora
0xshora Jun 24, 2024
c868748
Update dependencies, enable source map in vite config, and add new pa…
Jun 25, 2024
5017375
Update dependencies, enable source map in vite config, and add new pa…
Jun 25, 2024
004e32b
Prepare v0.3.8
Jun 25, 2024
a2983bb
Update @dojoengine dependencies to version 0.7.5 and adjust yarn.lock…
Jun 25, 2024
83efbc7
Merge branch 'main' into main
thiscaspar Jun 25, 2024
96de7fd
Merge pull request #15 from pixelaw/main
thiscaspar Jun 25, 2024
01be9f3
upgrading dependencies
Jun 25, 2024
d00fbe2
Merge branch 'main' into main
thiscaspar Jun 25, 2024
edcf622
Merge pull request #16 from pixelaw/main
thiscaspar Jun 25, 2024
4e1d7c2
remove .env
thiscaspar Jun 25, 2024
4b42eba
update
0xshora Jun 27, 2024
2e8ea86
docs: update README
0xshora Jun 27, 2024
41d7398
feat: add createProposal
0xshora Jun 27, 2024
da0d691
fix: modified UI
0xshora Jun 27, 2024
72ecf4a
Add Settings page with CSS module and update App.tsx to import it cor…
thiscaspar Jun 27, 2024
4a6d104
Merge remote-tracking branch 'refs/remotes/upstream/main'
thiscaspar Jun 27, 2024
cf519e2
Refactor color conversion functions and use numRGBAToHex in drawPixel…
thiscaspar Jun 27, 2024
014a6ad
Merge branch 'pixelaw:main' into feat/add-popup-proposallist
0xshora Jun 28, 2024
90149d9
Merge branch 'feat/add-popup-proposallist' into feat/popup-proposals
0xshora Jun 28, 2024
83afa4b
fix: error about hexRGBtoNumberRGBA
0xshora Jun 28, 2024
9451e8b
feat: add popup-proposals
0xshora Jun 28, 2024
950f257
feat: add-filter for proposals
0xshora Jun 29, 2024
b86bb96
Merge pull request #29 from pixelaw/feat/add-filter
0xshora Jun 29, 2024
9e274a1
feat: show address
0xshora Jun 29, 2024
3f17905
feat: show time limit
0xshora Jun 29, 2024
3119f8c
fix: bugs about initial states
0xshora Jun 29, 2024
0e9d17b
fix: bugs about initial states
0xshora Jun 29, 2024
fdde033
chore: add comments to show TODO(current_px)
0xshora Jun 29, 2024
92b3a26
Merge pull request #30 from pixelaw/feat/show-info
0xshora Jun 29, 2024
854b028
chore: changed the name from MakeADisaster to ResetToWhite
0xshora Jun 30, 2024
886b12d
fix: set color arrays for Rest To White
0xshora Jun 30, 2024
1d19f0f
feat: show current_px / max_px
0xshora Jun 30, 2024
5078675
Merge pull request #32 from pixelaw/feat/show-info
0xshora Jun 30, 2024
e747e9e
chore: fix the menubar css
0xshora Jun 30, 2024
662f016
feat: add dynamic palette colors
mariz-ov Jul 1, 2024
54f098f
wip: add dynamic palette colors
mariz-ov Jul 1, 2024
3930aeb
fix: color palette not dynamically changing
mariz-ov Jul 2, 2024
5bfb61b
Merge pull request #37 from pixelaw/feat/dynamic_color_palette
mariz-ov Jul 2, 2024
d074766
feat: show error message
mariz-ov Jul 2, 2024
086cb0b
Merge pull request #38 from pixelaw/feat/show_error_messages
mariz-ov Jul 2, 2024
607e02d
chore: update packages
0xshora Jul 2, 2024
91c273e
chore: clean error messages
0xshora Jul 2, 2024
6f93ff7
chore: change activate button to denied
0xshora Jul 2, 2024
b797d74
chore: changed the order of the palette
0xshora Jul 2, 2024
1ce7f12
chore: adjust the size of pixel:hover
0xshora Jul 2, 2024
cb585f9
chore: disable settings for playtest
0xshora Jul 2, 2024
43df3ac
Merge pull request #39 from pixelaw/fix/clean-error-msg
0xshora Jul 2, 2024
6077681
fix: px limit ui buggy
mariz-ov Jul 2, 2024
81de0a9
Merge remote-tracking branch 'origin/main' into fix/px_limit_ui_buggy
mariz-ov Jul 2, 2024
b69ce4e
Merge pull request #42 from pixelaw/fix/px_limit_ui_buggy
mariz-ov Jul 2, 2024
0e3900d
chore: disable non play area clicks
mariz-ov Jul 2, 2024
9c24a04
Merge pull request #43 from pixelaw/chore/disable_non_play_area_clicks
mariz-ov Jul 2, 2024
303d421
wip: setup dynamic proposals list
mariz-ov Jul 2, 2024
096f34f
Merge pull request #44 from pixelaw/fix/reacting_to_dojo_models_change
mariz-ov Jul 2, 2024
0445283
fix: activate button text
mariz-ov Jul 2, 2024
625d8bc
Merge pull request #45 from pixelaw/fix/activate_button
mariz-ov Jul 2, 2024
13d044c
chore: Highlight PX
0xshora Jul 2, 2024
2555258
fix: can drag when the zoom is equal to ZOOM_MIN
0xshora Jul 2, 2024
fdf0e90
chore: change the textcolor and voting power is set to >=0
0xshora Jul 2, 2024
6b19046
fix: options about reset is all allowedColorModels
0xshora Jul 2, 2024
6c336c0
chore: adjust toast
0xshora Jul 3, 2024
1216069
Merge pull request #51 from pixelaw/fix/some-bugs
0xshora Jul 3, 2024
c19ac6f
chore: update loading screen
0xshora Jul 3, 2024
32407cb
fix: extend game area
mariz-ov Jul 3, 2024
0849fdb
chore: adjust z of ToastContainer
0xshora Jul 3, 2024
140705d
feat: pop up new proposal created
mariz-ov Jul 3, 2024
5901e82
update pachages
0xshora Jul 3, 2024
265b644
fix: activate button
0xshora Jul 3, 2024
f04844d
chore: adjust params
0xshora Jul 3, 2024
3b4fb1c
chore: for test
0xshora Jul 4, 2024
703c8bd
chore: undo
0xshora Jul 4, 2024
8f49609
chore: adjust sizes about proposa-list popup
0xshora Jul 4, 2024
1331a82
chore: px=0 -> stand out
0xshora Jul 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,18 @@ It turned out in rearchitecting everything from the ground up, mostly to be able
- So to the left of x=0 is now x=4_294_967_295 but it all "just works"

# How to run it
- It's a regular Vite+React project, but you'll need the PixeLAW Core (dev)container running somewhere too.
please run [p_war](https://github.com/pixelaw/p_war) first.

```zsh
$ git clone [email protected]:pixelaw/p_war.git
$ cd ./p_war
```

then, please open the directory by using vscode, and build container with devcontainer.

```zsh
$ cd ../
$ git clone [email protected]:pixelaw/p_war_client.git
$ pnpm i
$ pnpm run dev
```
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.3.9
0.3.9
11 changes: 11 additions & 0 deletions graphql/GetAllowedColors.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
query GetAllowedColors($game_id: usize) {
allowedColorModels (where: { game_idEQ: $game_id } ) {
edges {
node {
game_id
color
is_allowed
}
}
}
}
15 changes: 15 additions & 0 deletions graphql/GetGame.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
query GetGame($id: usize) {
boardModels (where: { idEQ: $id }) {
edges {
node {
id,
origin {
x
y
}
height,
width
}
}
}
}
11 changes: 11 additions & 0 deletions graphql/GetPaletteColors.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
query GetPaletteColors {
paletteColorsModels(order: { direction: ASC, field: IDX}, where: { game_idEQ: 1}) {
edges {
node {
game_id
idx
color
}
}
}
}
10 changes: 10 additions & 0 deletions graphql/GetPixelRecoveryRate.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
query GetPixelRecoveryRate {
pixelRecoveryRateModels(where: { game_idEQ: 1}) {
edges {
node {
game_id
rate
}
}
}
}
15 changes: 15 additions & 0 deletions graphql/GetPlayer.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
query GetPlayer($player_address: ContractAddress) {
playerModels(where: { addressEQ: $player_address}) {
edges {
node {
address
max_px
num_owns
num_commit
current_px
last_date
is_banned
}
}
}
}
18 changes: 18 additions & 0 deletions graphql/GetProposals.graphql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
query GetProposals($game_id: usize) {
proposalModels (where: { game_idEQ: $game_id }, order: { direction: DESC, field: INDEX} ) {
edges {
node {
game_id
index
author
proposal_type
target_color
start
end
yes_px
no_px
is_activated
}
}
}
}
11 changes: 10 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,8 @@
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview",
"test": "vitest",
"coverage": "vitest run --coverage"
"coverage": "vitest run --coverage",
"create-components": "npx @dojoengine/core ./public/assets/manifest.json src/dojo/contractComponents.ts http://localhost:5050 0x60916a73fe631fcba3b2a930e21c6f7bb2533ea398c7bfa75c72f71a8709fc2"
},
"dependencies": {
"@dojoengine/core": "^0.7.5",
Expand All @@ -22,19 +23,27 @@
"@dojoengine/torii-client": "^0.7.5",
"@dojoengine/utils": "^0.7.5",
"@react-hook/resize-observer": "^2.0.1",
"@tanstack/react-query": "^5.49.2",
"@types/upng-js": "^2.1.5",
"autoprefixer": "^10.4.19",
"browserify-zlib": "^0.2.0",
"dotenv": "^16.4.5",
"graphql": "^16.8.1",
"graphql-request": "^7.0.1",
"graphql-tag": "^2.12.6",
"graphql-ws": "^5.16.0",
"idb-keyval": "^6.2.1",
"immer": "^10.1.1",
"micro-starknet": "^0.2.3",
"pngjs3": "^6.1.1",
"postcss": "^8.4.38",
"react": "^18.2.0",
"react-color": "^2.19.3",
"react-dom": "^18.2.0",
"react-icons": "^5.2.1",
"react-router-dom": "^6.23.1",
"react-select": "^5.8.0",
"react-toastify": "^10.0.5",
"starknet": "^6.9.0",
"tailwindcss": "^3.4.4",
"tailwindcss-animate": "^1.0.7",
Expand Down
Loading