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

Dummy UI for earn #1045

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft

Dummy UI for earn #1045

wants to merge 5 commits into from

Conversation

musidlo
Copy link
Contributor

@musidlo musidlo commented Jan 25, 2025

TODO:

  • main earn screen
    • plug active earnings numbers
    • show loader when numbers are loading
  • start earning form
    • calculate APY and bonuses when deposit amount changes
    • show loader when numbers are loading
    • plug links to terms
    • add tooltip with details of APY
  • active earnings screen
    • plug active earnings numbers
  • withdraw form
    • plug deposit balance
    • calculate how APY and bonuses will change
    • show loader when numbers are loading
    • plug links to terms
  • earnings balance screen
    • plug earnings balance
    • show loader when number are loading
    • add support for earnings related activities in list and details
    • filter activities to show only earnings related
  • rewards balance screen
    • plug rewards balance
    • show loader when numbers are loading
    • add support for rewards related activites in list and details
    • filter activities to show only rewards related

@musidlo musidlo requested a review from 0xBigBoss as a code owner January 25, 2025 17:48
@musidlo musidlo marked this pull request as draft January 25, 2025 17:48
parsedAmount > BigInt(0) &&
areTermsAccepted

const insufficientAmount =
Copy link
Contributor

Choose a reason for hiding this comment

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

Try to use the form error instead.

form.setError('amount', { type: 'custom', message: 'Insufficient balance' })

Then you can get the error like

const form = useForm()
form.formState.errors.amount
const { errors } = useFormState()
errors.amount


const canSubmit = depositBalance >= parsedAmount && parsedAmount > BigInt(0) && areTermsAccepted

const insufficientAmount = earnParams.amount !== undefined && parsedAmount > depositBalance
Copy link
Contributor

Choose a reason for hiding this comment

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

same here. try to leverage the form state. https://react-hook-form.com/docs/useform

Copy link
Contributor

@0xBigBoss 0xBigBoss left a comment

Choose a reason for hiding this comment

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

Mostly looks good to me. Let's be sure to hide it in the UI in production. Only show it in local dev in the sidebar.

@musidlo musidlo changed the title Added first part of dummy UI for earn Dummy UI for earn Feb 5, 2025
Copy link

Vercel Unique URL: https://sendapp-5qawtug7k-0xsend.vercel.app
Vercel Preview URL: sendapp-earn-ui-0xsend.vercel.app
Last Commit: 4c60a06

Copy link

Playwright Report

Summary

Expected Skipped Unexpected Flaky Duration
81 6 0 3 226.56s

Suites

account-rewards.onboarded.spec.ts

can visit rewards page

  • chromium: ✅
  • firefox: ✅

account-sendtag-checkout.onboarded.spec.ts

can visit checkout page

  • chromium: ✅
  • firefox: ✅

can add a pending tag

  • chromium: ✅
  • firefox: ✅

cannot add an invalid tag name

  • chromium: ✅
  • firefox: ✅

can confirm a tag

  • chromium: 🚨
  • firefox: ✅

can refer a tag

  • chromium: 🚨
  • firefox: ✅

can refer multiple tags in separate transactions

  • chromium: ✅
  • firefox: ✅

cannot confirm a tag without paying

  • chromium: ✅
  • firefox: ✅

cannot add more than 5 tags

  • chromium: ✅
  • firefox: ✅

account-settings-backup.onboarded.spec.ts

can backup account

  • chromium: ✅
  • firefox: ✅

can remove a signer

  • chromium: ✅
  • firefox: ✅

account.logged-in.spec.ts

can visit account page

  • chromium: ✅
  • firefox: ✅

can update profile

  • chromium: ✅
  • firefox: ✅

activity.onboarded.spec.ts

can visit activity page and see correct activity feed

  • chromium: ✅
  • firefox: ✅

can search on activity page

  • chromium: ✅
  • firefox: ✅

home.onboarded.spec.ts

can visit token detail page

  • chromium: ✅
  • firefox: ✅

leaderboard.logged-in.spec.ts

can visit leaderboard page

  • chromium: ✅
  • firefox: ✅

onboarding.logged-in.spec.ts

can visit onboarding page

  • chromium: ✅
  • firefox: ✅

profile.anon.spec.ts

anon user can visit public profile

  • chromium: ✅
  • firefox: ✅

anon user cannot visit private profile

  • chromium: ✅
  • firefox: ✅

profile.logged-in.spec.ts

logged in user needs onboarding before visiting profile

  • chromium: ✅
  • firefox: ✅

profile.onboarded.spec.ts

can visit other user profile and send by tag

  • chromium: ✅
  • firefox: ✅

can visit my own profile

  • chromium: ✅
  • firefox: ✅

can visit private profile

  • chromium: ✅
  • firefox: ✅

can view activities between another profile

  • chromium: ✅
  • firefox: ✅

send-token-upgrade.onboarded.spec.ts

can upgrade their Send Token V0 to Send Token V1

  • chromium: ✅
  • firefox: ✅

send.onboarded.spec.ts

can send USDC starting from profile page

  • chromium: ✅
  • firefox: ✅

can send USDC using tag starting from home page

  • chromium: ✅
  • firefox: ✅

can send USDC using sendid starting from home page

  • chromium: ✅
  • firefox: ✅

can send USDC using address starting from home page

  • chromium: ✅
  • firefox: ✅

can send ETH starting from profile page

  • chromium: 🚨
  • firefox: ✅

can send ETH using tag starting from home page

  • chromium: ✅
  • firefox: ✅

can send ETH using sendid starting from home page

  • chromium: ✅
  • firefox: ✅

can send ETH using address starting from home page

  • chromium: ✅
  • firefox: ✅

can send SEND starting from profile page

  • chromium: ✅
  • firefox: ✅

can send SEND using tag starting from home page

  • chromium: ✅
  • firefox: ✅

can send SEND using sendid starting from home page

  • chromium: ✅
  • firefox: ✅

can send SEND using address starting from home page

  • chromium: ✅
  • firefox: ✅

sign-in.anon.spec.ts

redirect on sign-in

  • chromium: ✅
  • firefox: ✅

redirect to send confirm page on sign-in

  • chromium: ✅
  • firefox: ✅

sign-up.anon.spec.ts

can sign up

  • chromium: ✅
  • firefox: ✅

country code is selected based on geoip

  • chromium: ✅
  • firefox: ✅

skip otp for existing user trying to sign up using already used phone number

  • chromium: ⏭
  • firefox: ⏭

user can sign in with passkey from backing up page

  • chromium: ⏭
  • firefox: ⏭

user can sign in as back up using otp from backing up page

  • chromium: ⏭
  • firefox: ⏭

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants