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

feat: add Matija's Homepage realm to examples #2916

Merged
merged 43 commits into from
Dec 10, 2024

Conversation

matijamarjanovic
Copy link
Contributor

Summary

This pull request adds a new realm example to the Gno examples repository—Matija's Homepage. It showcases a personal homepage built on the Gno chain where users can interact by voting with GNOT tokens to change the page's color. The more tokens users send, the greater influence they have on the color scheme, providing an interactive and dynamic experience.

Key Features

  • Profile Section: Displays a personal profile with an image and description.
  • Color Voting: Users can vote for the page's color (red, green, blue) by sending GNOT tokens. RGB values are adjusted based on the amount sent.
  • Dynamic Updates: The homepage dynamically updates the color based on votes, showcasing real-time interaction on the Gno blockchain.
  • Links to GitHub and LinkedIn: Includes buttons for GitHub and LinkedIn, making it easy for users to connect.

Tools & Technologies

  • Utilizes Gno's native functions to handle voting and token transfers.
  • Provides a simple, yet effective example of how personal realms can be interactive and engaging on the Gno platform.

Why this is valuable

This example highlights the possibilities of personal realms on Gno, showing how users can create unique and interactive profiles. It’s a fun and approachable entry point for anyone new to Gno development, while also demonstrating the platform's flexibility and potential for creative expression.

@matijamarjanovic matijamarjanovic requested review from a team as code owners October 7, 2024 02:27
@matijamarjanovic matijamarjanovic requested review from ltzmaxwell and gfanton and removed request for a team October 7, 2024 02:27
@github-actions github-actions bot added the 🧾 package/realm Tag used for new Realms or Packages. label Oct 7, 2024
@matijamarjanovic matijamarjanovic changed the title Matija's Homepage Realm Example feat: Matija's Homepage Realm Example Oct 7, 2024
@jefft0 jefft0 added the review/triage-pending PRs opened by external contributors that are waiting for the 1st review label Oct 8, 2024
@matijamarjanovic matijamarjanovic changed the title feat: Matija's Homepage Realm Example feat: add Matija's Homepage realm to examples Oct 8, 2024
Copy link
Member

@notJoon notJoon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left some comments. please check them out. thank you

examples/gno.land/r/matijamarjanovic/config/config.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/config/config.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/config/config.gno Outdated Show resolved Hide resolved
matijamarjanovic and others added 4 commits October 10, 2024 16:11
…ble's names are seems ambiguous. Could you update their names? like mainAddr)
… on PR - error messages are repeated (invalid arress and unauthorized). please make them as constant.)
…mment on PR - very niptick: consider change parameter name a to more concrete name.)
@matijamarjanovic
Copy link
Contributor Author

matijamarjanovic commented Oct 10, 2024

Thank you for your insights @notJoon. I've fixed the issues, please let me know if I can make anything more appropriate.

Copy link

@Maelkum Maelkum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Passerby here, feel free to ignore my comments. Was just passing by and was curious about why some things are the way they are

examples/gno.land/r/matijamarjanovic/home/config.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/home/config.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/home/config.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/home/home.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/home/home.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/home/home.gno Outdated Show resolved Hide resolved
examples/gno.land/r/matijamarjanovic/home/home.gno Outdated Show resolved Hide resolved
@matijamarjanovic
Copy link
Contributor Author

matijamarjanovic commented Oct 14, 2024

Thank you for your review @Maelkum before I say anything I have to say that this is the first thing I have built in Gno and generally on gno chain. This was built by following @leohhhn's live coding session (which is on gno.land's Youtube channel) where he built his own homepage which is in the examples. This is why I chose to do some of the things I did the way I did them. I fixed couple of the things you mentioned that I thought needed fixing, the rest I will try explaining in the replies to your comments.

@thehowl
Copy link
Member

thehowl commented Oct 23, 2024

Putting in draft, click ready for review when it's ready for a second look.

@Gno2D2
Copy link
Collaborator

Gno2D2 commented Dec 9, 2024

I'm a bot that assists the Gno Core team in maintaining this repository. My role is to ensure that contributors understand and follow our guidelines, helping to streamline the development process.

The following requirements must be fulfilled before a pull request can be merged.
Some requirement checks are automated and can be verified by the CI, while others need manual verification by a staff member.

These requirements are defined in this configuration file.

Automated Checks

🟢 Maintainers must be able to edit this pull request (more info)
🟢 The pull request head branch must be up-to-date with its base (more info)

Manual Checks

  • The pull request description provides enough details (checked by @leohhhn)
Debug
Automated Checks
Maintainers must be able to edit this pull request (more info)

If

🟢 Condition met
└── 🟢 The pull request was created from a fork (head branch repo: matijamarjanovic/gno)

Then

🟢 Requirement satisfied
└── 🟢 Maintainer can modify this pull request

The pull request head branch must be up-to-date with its base (more info)

If

🟢 Condition met
└── 🟢 On every pull request

Then

🟢 Requirement satisfied
└── 🟢 Head branch (matijamarjanovic:master) is up to date with base (master): behind by 0 / ahead by 43

Manual Checks
The pull request description provides enough details

If

🟢 Condition met
└── 🟢 Not (🔴 Pull request author is a member of the team: core-contributors)

Can be checked by

  • team core-contributors

- reorganize the home.gno so it doesn't use html anymore but mark down lib by @thanhgoc541
- change logic to vote for theme of the page instead of color
- change pfp

ps: lib used for .md is manually imported since the PR is still not merged
@matijamarjanovic
Copy link
Contributor Author

matijamarjanovic commented Dec 9, 2024

To leave a quick comment on the new look and logic of the home realm:

  • Since there is no more HTML i have made up three themes of the home realm, since markdown is pretty restrictive these themes look similar but the difference can be made
  • The voting system is still used even though now there is no spectrum of values like there is in rgb. Instead, the theme with the most votes at a time is used
  • The number of votes is now measured by number of ugnots the realm is holding for the specific theme and this time there is no normalization, again, this is because there is a lack of a spectrum
  • For generating components in markdown I have used this library suggested by @leohhhn

Realm is not deployed to any network as I have already taken a couple of namespaces and don't want to keep doing that, instead I am looking to get this approved and get my original namespace :)

PS it is getting registered to the Hall of Realms

@matijamarjanovic matijamarjanovic marked this pull request as ready for review December 9, 2024 15:54
@leohhhn
Copy link
Contributor

leohhhn commented Dec 9, 2024

Hey @matijamarjanovic,

Generally you shouldn't take other people's code like this (the MDUI pkg). I know this was not your intention, but what you did was just copy paste this lib and if this PR is merged it will be your commit, effectively denying the original author their rights.

What you should do, is, either use a library that exists in master (p/moul/md was merged recently), or make a branch from the branch that contains the code you want to use, which will make your PR dependent on the original PR you branched off of.

I suggest you switch to using p/moul/md and I'll take a look. It shouldn't be too big of a change.

@matijamarjanovic
Copy link
Contributor Author

matijamarjanovic commented Dec 9, 2024

Hey @matijamarjanovic,

Generally you shouldn't take other people's code like this (the MDUI pkg). I know this was not your intention, but what you did was just copy paste this lib and if this PR is merged it will be your commit, effectively denying the original author their rights.

What you should do, is, either use a library that exists in master (p/moul/md was merged recently), or make a branch from the branch that contains the code you want to use, which will make your PR dependent on the original PR you branched off of.

I suggest you switch to using p/moul/md and I'll take a look. It shouldn't be too big of a change.

I thught this might be an issue and i agree, I even credited the author in the code through a comment above the code. I'll be commiting the fix in the next hour

Copy link
Contributor

@leohhhn leohhhn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯

@leohhhn
Copy link
Contributor

leohhhn commented Dec 10, 2024

Just check the CI; for example, you should run make fmt in the examples folder (also see in the makefile what this command does)

@thehowl thehowl merged commit 4e7305b into gnolang:master Dec 10, 2024
105 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🧾 package/realm Tag used for new Realms or Packages.
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

7 participants