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(rakki): UI enhancement #1434

Merged
merged 16 commits into from
Dec 30, 2024
Merged

feat(rakki): UI enhancement #1434

merged 16 commits into from
Dec 30, 2024

Conversation

WaDadidou
Copy link
Collaborator

@WaDadidou WaDadidou commented Dec 3, 2024

This is an enhancement of the UI of this: https://app.teritori.com/rakki
I splitted RakkiScreen in many components and made UI changes:

  • Show the user's tickets count
  • Add "Connect Wallet" in the Buy Tickets modal
  • I would like to add "Deposit funds" in the Buy Tickets modal, but there is a bug, so it's just commented
  • Add missing UI elements
  • Fix some styles
  • Split RakkiScreen.tsx (Just putted components in unitary files)

Check the before: https://app.teritori.com/rakki
And the after: https://deploy-preview-1434--teritori-dapp.netlify.app/rakki

Figma: https://www.figma.com/design/WLEMAQXohIwBEPL5lsRrvK/Teritori---dApp?node-id=21858-204224&node-type=canvas&t=nEn47C5PtwMI9RWy-0

Highlights:

Connect Wallet button at the end of the flow (If user not connected)

image

This is now clickable and opens the BuyTicketsModal

image

In the modal, I put japanese text on the image

image

"Your tickets" is your tickets

image

"Deposit funds" if not enough funds

image

New contract instantiated version
Add missing UI elements
Fix some styles
@WaDadidou WaDadidou added enhancement New feature or request UX/UI labels Dec 3, 2024
@WaDadidou WaDadidou self-assigned this Dec 3, 2024
Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for gno-dapp ready!

Name Link
🔨 Latest commit f6f6349
🔍 Latest deploy log https://app.netlify.com/sites/gno-dapp/deploys/677255f01fda1600086c534b
😎 Deploy Preview https://deploy-preview-1434--gno-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link

netlify bot commented Dec 3, 2024

Deploy Preview for teritori-dapp ready!

Name Link
🔨 Latest commit f6f6349
🔍 Latest deploy log https://app.netlify.com/sites/teritori-dapp/deploys/677255f0c9d70a00083ec744
😎 Deploy Preview https://deploy-preview-1434--teritori-dapp.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

Copy link
Collaborator

@clegirar clegirar left a comment

Choose a reason for hiding this comment

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

The bug in the Buy Tickets modal is out of scope of this PR or you want to spend more time in here to fix it ?

I don't really like this kind of big files with 600 lines, it's complicated to read, especially when it's the first time you read it ^^ But there is some components that are split inside so it's okay, and it's out of scope i understand that.

Else the design fit with the figma, but i don't have tori to test the feature on testnet, so i can't buy tickets to test the behaviour.

@WaDadidou WaDadidou requested a review from clegirar December 6, 2024 19:52
@WaDadidou WaDadidou changed the title feat(rakki): Show user's ticket counts feat(rakki): UI enhancement Dec 6, 2024
@WaDadidou
Copy link
Collaborator Author

The bug in the Buy Tickets modal is out of scope of this PR or you want to spend more time in here to fix it ?

I don't really like this kind of big files with 600 lines, it's complicated to read, especially when it's the first time you read it ^^ But there is some components that are split inside so it's okay, and it's out of scope i understand that.

I splitted :)

@WaDadidou WaDadidou requested a review from n0izn0iz December 7, 2024 19:12
clegirar
clegirar previously approved these changes Dec 9, 2024
Copy link
Collaborator

@clegirar clegirar left a comment

Choose a reason for hiding this comment

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

Found the code better to read 👍 I don't know a lot this feature so i can just give my opinion on pure code/archi etc.
I tested to buy tickets, have i to test specific thing ? I tested to buy 1, and 20 tickets and it works

@WaDadidou
Copy link
Collaborator Author

Found the code better to read 👍 I don't know a lot this feature so i can just give my opinion on pure code/archi etc. I tested to buy tickets, have i to test specific thing ? I tested to buy 1, and 20 tickets and it works

The feature's UX is pretty simple, there is nothing more you can test

# Conflicts:
#	networks.json
#	packages/networks/teritori-testnet/index.ts
#	packages/screens/Rakki/RakkiScreen.tsx
packages/hooks/rakki/useRakkiTicketsByUser.ts Outdated Show resolved Hide resolved
packages/hooks/rakki/useRakkiTicketsByUser.ts Outdated Show resolved Hide resolved
import { RakkiClient } from "@/contracts-clients/rakki";
import { getKeplrSigningCosmWasmClient } from "@/networks/signer";

// TODO: replace all placeholders text with real values
Copy link
Collaborator

Choose a reason for hiding this comment

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

this TODO is not addressed, we should address it or not remove it

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

2f5bf64#diff-8e2c5b8031f032da60995a2ec1bed47f31b3db49f0ce3de39821c1d7f26382cfR21

What are these placeholders ? I thought it was good, my bad

Copy link
Collaborator

Choose a reason for hiding this comment

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

at the bottom, there is hardcoded $10k and stuff like that

Copy link
Collaborator Author

@WaDadidou WaDadidou Dec 20, 2024

Choose a reason for hiding this comment

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

Copy link
Collaborator

Choose a reason for hiding this comment

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

Should we reduce size of this image ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes, I used a PNG version because the SVG exported from Figma is glitched.
I asked help to Leonid

const { data: ticketsCount = null, ...other } = useQuery(
["rakkiTicketsCountByUser", userId],
async () => {
if (!userId) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

I think we can use useQuery option: enabled: !!userId

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yes!
a1ada4e

const [isButtonHovered, setButtonHovered] = useState(false);
const [isModalVisible, setModalVisible] = useState(false);
const remainingTickets = info.config.max_tickets - info.current_tickets_count;
const [ticketAmount, setTicketAmount] = useState("1");
Copy link
Collaborator

@hthieu1110 hthieu1110 Dec 28, 2024

Choose a reason for hiding this comment

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

Why this "amount" is in string format and we have to convert remainingTickets to string :o

Copy link
Collaborator Author

@WaDadidou WaDadidou Dec 28, 2024

Choose a reason for hiding this comment

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

I forgot to remove this piece of code from here. See: #1434 (comment)

a1ada4e

}> = ({ visible, setModalVisible, info, networkId }) => {
const selectedWallet = useSelectedWallet();
const remainingTickets = info.config.max_tickets - info.current_tickets_count;
const [ticketAmount, setTicketAmount] = useState("1");
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMHO, if possible, we should use tickerAmount as number format , it's not a "big" number so we should process its value from the input to have the number format instead of string which is quite confusing

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry for adding these changes..
I didn't modify that is this PR, just splitted code from RakkiScreen.tsx.
This piece of code is the same as on origin/main: https://github.com/TERITORI/teritori-dapp/blob/main/packages/screens/Rakki/RakkiScreen.tsx#L119

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Same answer for this comment: #1434 (comment)

fontWeight: "600",
}}
>
RAKKi
Copy link
Member

Choose a reason for hiding this comment

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

should it be RAKKI ? or Rakki ?

Copy link
Collaborator Author

@WaDadidou WaDadidou Dec 28, 2024

Choose a reason for hiding this comment

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

It's RAKKi :)
Same as https://app.teritori.com/rakki

MikaelVallenet
MikaelVallenet previously approved these changes Dec 28, 2024
Copy link
Collaborator

@hthieu1110 hthieu1110 left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Collaborator

@n0izn0iz n0izn0iz left a comment

Choose a reason for hiding this comment

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

LGTM

@WaDadidou WaDadidou added this pull request to the merge queue Dec 30, 2024
Merged via the queue into main with commit b5e1d1e Dec 30, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request UX/UI
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants