-
Notifications
You must be signed in to change notification settings - Fork 7
feat: GnoPub #14
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
base: main
Are you sure you want to change the base?
feat: GnoPub #14
Conversation
|
Check the CI! |
packages/r/pierre115/gnopub/grid.gno
Outdated
| espace = " " | ||
| ) | ||
|
|
||
| // voir diff avec leon/svgbtn.gno |
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.
Write the comment in English, not French
packages/r/pierre115/gnopub/grid.gno
Outdated
|
|
||
| // If the cell is owned by someone else, link to their pub if set | ||
| if cell.Owner != "" && cell.Owner != caller { | ||
| if cell.Url != "" { |
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.
This condition body can be simplified
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.
Hi this is done here : 8958999!
packages/r/pierre115/gnopub/grid.gno
Outdated
| } | ||
|
|
||
| // Render the grid | ||
| func RenderGrid() string { |
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.
This function is massive, think of adding sub function to make it easier to read.
Also set the cellSize constant in global, it's overall a good practice to centralize all your constant to easily spot them when checking the source, or testing.
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.
Thanks ,here is the fix : 9eab2e1
| @@ -0,0 +1,2 @@ | |||
| module = "gno.land/r/pierre115/gnopub" | |||
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.
gnoads would make more sense (advertisment)
gnopub more means gno public in english (Not publicité)
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.
Thanks ! 2acd643
|
|
||
| // Function to sell a cell | ||
| func SellCells(_ realm, x, y int) string { | ||
| if x < 0 || x >= grid.Width || y < 0 || y >= grid.Height { |
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.
This condition is repeated, you can make a sub function
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.
Hi , this is the fix : 9441d86
packages/r/pierre115/gnopub/grid.gno
Outdated
| Url: "", | ||
| Label: "", | ||
| } | ||
| return ufmt.Sprintf("Cells selled!", x, y) |
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.
| return ufmt.Sprintf("Cells selled!", x, y) | |
| return ufmt.Sprintf("The cell was successfully sold.", x, y) |
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.
Take time to think about the return sentences with correct English, because it is an interface to the users.
It should look clean to be used.
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.
Its corrected !
packages/r/pierre115/gnopub/grid.gno
Outdated
| } | ||
|
|
||
| // Function to update the Pub and the Label of yours cells | ||
| func UpdateCells(_ realm, x, y int, url, label string) string { |
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.
| func UpdateCells(_ realm, x, y int, url, label string) string { | |
| func UpdateCell(_ realm, x, y int, url, label string) string { |
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.
Overall fix all the incorrect English from your code
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.
This is fixed here : aae2178
Thanks !
packages/r/pierre115/gnopub/grid.gno
Outdated
|
|
||
| } | ||
| } | ||
| // si on remonte d'une accolade ca marche plus :( |
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.
| // si on remonte d'une accolade ca marche plus :( |
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.
Its corrected !
leohhhn
left a comment
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.
Leaving some comments to make your code better :)
packages/r/pierre115/gnopub/grid.gno
Outdated
| continue | ||
| } | ||
| } | ||
| link = ufmt.Sprintf("/r/gnopixel$help&func=BuyCell&x=%d&y=%d", x, y) |
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.
Cool library to check out is p/moul/txlink
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.
This has not been resolved yet
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.
Thanks ! 57f2a12
packages/r/pierre115/gnopub/grid.gno
Outdated
|
|
||
| espace = " " | ||
|
|
||
| defaultlink = ufmt.Sprintf("https://gno.land/r/leon/hor:hall") |
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.
this link will not work for all networks; this is specific for staging. please change it so that it's network agnostic
packages/r/pierre115/gnopub/grid.gno
Outdated
| ) | ||
|
|
||
| // Render the grid | ||
| func RenderGrid() string { |
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.
Does this need to be exported?
packages/r/pierre115/gnopub/grid.gno
Outdated
|
|
||
| // Function to sell a cell | ||
| func SellCell(_ realm, x, y int) string { | ||
| if err := GetValidate(x, y); err != "" { |
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.
GetValidate is a weird name, and it's exported for some reason?
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.
Yes, its fixed here : 0003d77 !
| @@ -0,0 +1,2 @@ | |||
| module = "gno.land/r/pierre115/gnoads" | |||
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.
gnoads != gnopub. Make it all match
leohhhn
left a comment
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.
still a few unresolved comments, take a look at them and fix them up please :)
GnoADS 📺:
I aimed to recreate an advertising space similar to the Sandbox project, but encountered several challenges when trying to paste and integrate images onto the clickable surface.
For now, the concept focuses on building an advertising grid where individual slots can be bought and sold. Once a plot is purchased, it becomes a link to the buyer’s advertisement, which can be configured using the
UpdateCellfunction.Each ad is tied to a specific cell, allowing users to own multiple spaces for different promotional content.
Tutorial :
Step 1 :
Buy a cell with the function
BuyCellStep 2 :
Set the ads and the label with the function
UpdateCellon yours cellsStep 3 :
Sell your cells with the function
SellCell#Cell Structure
Preview
RoadMap :
-Add determined price (totalcells / availablecells) * baseprice
-Add number of clicks
*The price of a cell is currently free.