Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
177 commits
Select commit Hold shift + click to select a range
0797396
feat: update setup component for notification modal
kushagrasarathe Sep 9, 2025
dd31bc9
feat: notifications pop-up, ui and hook
kushagrasarathe Sep 9, 2025
c2bbb0d
feat: use react sdk methods from onesignal
kushagrasarathe Sep 9, 2025
4577606
Merge branch 'peanut-wallet-dev' into feat/notifications
kushagrasarathe Sep 10, 2025
5ec9b93
Merge branch 'peanut-wallet-dev' into feat/notifications
kushagrasarathe Sep 10, 2025
9623812
Merge branch 'peanut-wallet-dev' into feat/notifications
kushagrasarathe Sep 17, 2025
cc3eb8a
feat: copy changes
Zishan-7 Sep 18, 2025
35c3720
Invites UI
Zishan-7 Sep 21, 2025
306b263
add basic API integration
Zishan-7 Sep 21, 2025
6046db0
update flow and integrate valid Invite code check
Zishan-7 Sep 22, 2025
358d7d7
Merge branch 'peanut-wallet-dev' into feat/notifications
kushagrasarathe Sep 23, 2025
bc7a06a
feat: resolve cr comments
kushagrasarathe Sep 23, 2025
0b2f69b
Merge branch 'peanut-wallet-dev' into feat/notifications
kushagrasarathe Sep 23, 2025
8e01811
feat: notifications routes sevice
kushagrasarathe Sep 23, 2025
835f7b0
feat: homepage notification bell for navigation
kushagrasarathe Sep 23, 2025
c1baee2
feat: notificaitons page
kushagrasarathe Sep 23, 2025
b295e82
fix: resolve more cr comments
kushagrasarathe Sep 23, 2025
88af85c
fix: notif modal ux copy
kushagrasarathe Sep 23, 2025
940e0bb
Merge branch 'feat/notifications-fixed' into feat/notifications-center
kushagrasarathe Sep 23, 2025
345febd
chore: format
kushagrasarathe Sep 23, 2025
10d2fd7
feat: integrate waitlist logic
Zishan-7 Sep 24, 2025
9e7bcc8
feat: integrate /invites page
Zishan-7 Sep 24, 2025
3eff7ad
fix: pr review comments #1
kushagrasarathe Sep 24, 2025
e89783c
fix: more pr review comments #2
kushagrasarathe Sep 24, 2025
351e9fe
Merge branch 'feat/notifications-fixed' into feat/notifications-center
kushagrasarathe Sep 24, 2025
c9774fb
feat: add error state in notis page
kushagrasarathe Sep 24, 2025
2ffda52
chore: style
kushagrasarathe Sep 24, 2025
54e298e
integrate payment link invites
Zishan-7 Sep 24, 2025
6d430da
Add copy invite logic
Zishan-7 Sep 24, 2025
c49c5d7
fix: resolve cr comment
kushagrasarathe Sep 24, 2025
e352b5f
Merge pull request #1248 from peanutprotocol/feat/notifications-center
kushagrasarathe Sep 24, 2025
9a9b0da
add collect email flow
Zishan-7 Sep 25, 2025
67cd406
fix: bugs and fixes
Zishan-7 Sep 25, 2025
9118f50
fix: improve user access checks and update image import in ActionList
Zishan-7 Sep 25, 2025
0ecd8f0
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Sep 25, 2025
5d26f18
fix: add missing dependency
Zishan-7 Sep 25, 2025
f08a31c
fix: build error
Zishan-7 Sep 25, 2025
fcec045
fix: enhance username handling in ActionList and improve error handli…
Zishan-7 Sep 25, 2025
29e3fde
Invites changes
Zishan-7 Sep 26, 2025
a456a6e
add icons
Zishan-7 Sep 26, 2025
d76a524
refactor: simplify layout component by removing conditional rendering…
Zishan-7 Sep 28, 2025
0c22330
fix: update text for clarity and accuracy across multiple components
Zishan-7 Sep 28, 2025
4a85e54
Fix typo
Zishan-7 Sep 29, 2025
8ef5110
add widdge animation
Zishan-7 Sep 29, 2025
9c8dad4
feat: auto mark notif on read when user visits notifs page
kushagrasarathe Sep 29, 2025
9f6bd9c
fix nits and bugs
Zishan-7 Sep 29, 2025
85e098a
refactor: replace CopyToClipboardButton with CopyToClipboard component
Zishan-7 Sep 29, 2025
eaaf636
create invite interface
Zishan-7 Sep 29, 2025
e15f64b
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Sep 29, 2025
bbb5272
Add payment invite type
Zishan-7 Sep 29, 2025
2911337
fix: minor bug and fixes
Zishan-7 Sep 29, 2025
3464c01
improve error handling
Zishan-7 Sep 29, 2025
6bb4c7b
update animation
Zishan-7 Sep 29, 2025
0a68369
update animation
Zishan-7 Sep 29, 2025
dc41841
replace tooltip with modal
Zishan-7 Sep 30, 2025
a556646
remove comment
Zishan-7 Sep 30, 2025
bb39196
refactor: replace star icon animation with InvitesIcon component and …
Zishan-7 Sep 30, 2025
ed23e30
fix: undefined user error
Zishan-7 Sep 30, 2025
6203071
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Sep 30, 2025
a5a9397
Merge branch 'peanut-wallet-dev' into feat/notifications-fixed
kushagrasarathe Sep 30, 2025
570656f
fix: undefined user error
Zishan-7 Sep 30, 2025
e785ae0
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Sep 30, 2025
5f8d924
fix: UI bugs and Dont lose invite not showing on daimo method
Zishan-7 Oct 1, 2025
ed5c25d
feat: add showConfirmModal prop to ActionListDaimoPayButton for invit…
Zishan-7 Oct 1, 2025
4ae9427
feat: add error handling for invite code validation in JoinWaitlist c…
Zishan-7 Oct 1, 2025
1b8f4ae
Merge branch 'peanut-wallet-dev' into feat/notifications-fixed
kushagrasarathe Oct 1, 2025
99358f3
fix: update notifications setup modal ui
kushagrasarathe Oct 1, 2025
bc8e290
feat: use banners corousel for notifs banner
kushagrasarathe Oct 1, 2025
276f416
fix: notif hub responsiveness
kushagrasarathe Oct 1, 2025
7281c38
feat: mark notif read on click
kushagrasarathe Oct 2, 2025
8ae0b8d
Merge branch 'peanut-wallet-dev' into feat/notifications-fixed
kushagrasarathe Oct 2, 2025
14009c8
fix: claim route not working
Zishan-7 Oct 2, 2025
08dd943
refactor: remove inviteCode dependency from useEffect in SetupLayoutC…
Zishan-7 Oct 2, 2025
f8dfbc0
Fix: browser not supported error on mobile
Zishan-7 Oct 2, 2025
a2616cc
Remove `Refer` text
Zishan-7 Oct 2, 2025
a3c38fa
design updates
Zishan-7 Oct 3, 2025
69cde04
fix: email error message
Zishan-7 Oct 3, 2025
632635e
fix: home screen flashes before logout
Zishan-7 Oct 3, 2025
0ee0f27
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Oct 3, 2025
c35a9f8
fix: only show token and network field when its not peanut token/chain
kushagrasarathe Oct 3, 2025
96a0eb2
fix: balance formatting in send flow
kushagrasarathe Oct 3, 2025
0e4fa50
add social preview
Zishan-7 Oct 3, 2025
4eddeaa
remove logs
Zishan-7 Oct 3, 2025
e89dca0
fix: bugs
Zishan-7 Oct 3, 2025
94f1154
update social preview description
Zishan-7 Oct 3, 2025
90c16a1
fix: reset payment state on component unmount
Zishan-7 Oct 6, 2025
8e64fe8
fix: dispatch resetPaymentState on component unmount
Zishan-7 Oct 6, 2025
2f03a3a
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/ide…
Zishan-7 Oct 6, 2025
b60fa31
Merge pull request #1263 from peanutprotocol/feat/identity-verificati…
Zishan-7 Oct 6, 2025
7f5c632
Merge pull request #1280 from peanutprotocol/fix/maintainance-setup
kushagrasarathe Oct 6, 2025
c5d3958
Merge branch 'peanut-wallet' into sync/hotfix
kushagrasarathe Oct 6, 2025
bcb7074
Merge pull request #1289 from peanutprotocol/sync/hotfix
Hugo0 Oct 6, 2025
207142a
add peanutman logo on top of modal
Zishan-7 Oct 6, 2025
1c295fc
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Oct 6, 2025
1228144
coderrabit suggestions
Zishan-7 Oct 6, 2025
6891653
refactor: remove unused selectedStep variable and clean up dependenci…
Zishan-7 Oct 6, 2025
5f73ebe
Merge pull request #1256 from peanutprotocol/feat/lp-improvements
Zishan-7 Oct 6, 2025
8e3adb0
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 Oct 6, 2025
dacb05e
Merge pull request #1251 from peanutprotocol/feat/invites
Zishan-7 Oct 6, 2025
fd40f03
feat: add Invites heart tag badge
Zishan-7 Oct 6, 2025
a0fdac5
fix: update clip-path to clipPath in InviteHeartIcon and remove unnec…
Zishan-7 Oct 6, 2025
5dc62d2
fix: notifs modal/banner state related issues
kushagrasarathe Oct 6, 2025
1683e4f
Merge branch 'peanut-wallet-dev' into feat/notifications-fixed
kushagrasarathe Oct 6, 2025
e13e7dc
fix: try short delays for banner
kushagrasarathe Oct 6, 2025
55a8b96
fix: double click issue
kushagrasarathe Oct 6, 2025
cb172fd
update comment
Zishan-7 Oct 6, 2025
0e0be0c
feat: update HomeHistory component to display different empty states …
Zishan-7 Oct 6, 2025
02e98d8
Merge pull request #1291 from peanutprotocol/feat/invites-tag-badge
Zishan-7 Oct 6, 2025
90c72c8
fix: show only one modal at a time
kushagrasarathe Oct 6, 2025
08fafed
add 1 second delay in login flow
Zishan-7 Oct 7, 2025
0027be7
refactor: add readiness check before redirecting in layout and remove…
Zishan-7 Oct 7, 2025
a4d8c87
fix: update isLoading to isFetching in useUserQuery for consistency
Zishan-7 Oct 7, 2025
5bb8f9c
fix: user has to login twice
Zishan-7 Oct 7, 2025
fa8c627
feat: add no more jail modal
Zishan-7 Oct 7, 2025
361ec14
Merge pull request #1292 from peanutprotocol/feat/public-profile-empt…
Zishan-7 Oct 7, 2025
986c883
remove clearing useState vars and remove dispatch dependency
Zishan-7 Oct 7, 2025
3ffb529
Merge pull request #1288 from peanutprotocol/fix/txn-amount-state-reset
Zishan-7 Oct 7, 2025
47a1e18
update invites icon animation
Zishan-7 Oct 7, 2025
a76fea8
Merge branch 'peanut-wallet-dev' into feat/notifications-fixed
kushagrasarathe Oct 7, 2025
a797ed3
feat: handle fetching timeout
jjramirezn Oct 7, 2025
535498a
feat: add receipt for send link
jjramirezn Oct 7, 2025
3e1e1e3
feat: add early user modal
Zishan-7 Oct 8, 2025
d84fed1
refactor: move sessionStorage check inside useEffect for NoMoreJailModal
Zishan-7 Oct 8, 2025
02162da
feat: enhance LockIcon component to accept props for better customiza…
Zishan-7 Oct 8, 2025
5b33ba8
fixes and improvements
Zishan-7 Oct 8, 2025
670e894
Merge pull request #1293 from peanutprotocol/fix/invites-qa-fixes
Zishan-7 Oct 8, 2025
8cfdbcb
fix: add timeout to fetch
jjramirezn Oct 8, 2025
aca307e
Merge pull request #1296 from peanutprotocol/feat/handle-fetching-tim…
jjramirezn Oct 8, 2025
476f1ec
update heart icon and add icon in front of inviter
Zishan-7 Oct 8, 2025
459f5aa
add inviter name
Zishan-7 Oct 8, 2025
35bae2c
update early user modal copy
Zishan-7 Oct 8, 2025
cd91737
refactor: update tooltip ID for inviter user in UserHeader component
Zishan-7 Oct 8, 2025
94d5fd6
refactor: rename tooltip ID for invited user in UserHeader component
Zishan-7 Oct 8, 2025
00b083b
Merge pull request #1299 from peanutprotocol/feat/inviter-name
Zishan-7 Oct 8, 2025
7f953ef
fix: remove search from homepage
kushagrasarathe Oct 8, 2025
6140301
Merge branch 'peanut-wallet-dev' into feat/notifications-fixed
kushagrasarathe Oct 8, 2025
c566a48
Merge pull request #1247 from peanutprotocol/feat/notifications-fixed
kushagrasarathe Oct 8, 2025
6f7b923
fix: formatting
jjramirezn Oct 8, 2025
324fd93
Merge pull request #1297 from peanutprotocol/feat/receipt-for-send-link
jjramirezn Oct 8, 2025
816b645
fix: Home carousel not clickable
Zishan-7 Oct 9, 2025
8e486c3
Merge pull request #1302 from peanutprotocol/fix/carousel-not-clickable
Zishan-7 Oct 9, 2025
9b0eb81
fix: use formatCurrency
kushagrasarathe Oct 9, 2025
e706d36
feat: remove different icon for inviter
Zishan-7 Oct 9, 2025
e4b3e23
fix: remember in
Zishan-7 Oct 9, 2025
3e6db81
fix: Invalid invite code issue
Zishan-7 Oct 9, 2025
8a5fb34
fix:heart icon not present
Zishan-7 Oct 9, 2025
0edcf4c
fix: toast z-index
Zishan-7 Oct 9, 2025
a3db2b1
Merge pull request #1279 from peanutprotocol/fix/token-row-in-receipt
jjramirezn Oct 9, 2025
7cc1c8e
fix: render condition
kushagrasarathe Oct 9, 2025
c73d178
fix: resolve cr comment
kushagrasarathe Oct 9, 2025
dd22738
Merge pull request #1308 from peanutprotocol/fix/token-row
kushagrasarathe Oct 9, 2025
012f616
fix: ensure loading state is handled correctly in PointsPage
Zishan-7 Oct 9, 2025
b7ad3ee
Merge pull request #1306 from peanutprotocol/fix/toast-zindex
Hugo0 Oct 9, 2025
b2c49ba
Merge pull request #1303 from peanutprotocol/fix/invite-bugs
Zishan-7 Oct 9, 2025
483c7b0
Fix: update setup flow
Zishan-7 Oct 10, 2025
2848213
feat: accept invite before claiming and fulfiling request
Zishan-7 Oct 10, 2025
6533707
feat: create useLogin hook and fix logout bug on invites page
Zishan-7 Oct 10, 2025
7488af2
disable kycApprovedModal
Zishan-7 Oct 10, 2025
471f1d9
fix: star position
Zishan-7 Oct 10, 2025
fe8c9fc
fix: guard against external urls
Zishan-7 Oct 10, 2025
24a1570
refactor: update KYC status check in useBanners hook
Zishan-7 Oct 10, 2025
63c9e69
Merge pull request #1313 from peanutprotocol/feat/home-ctas-manteca
kushagrasarathe Oct 10, 2025
421a0e3
fixes
Zishan-7 Oct 10, 2025
142248c
update earn modal copy
Zishan-7 Oct 10, 2025
d8bc95c
address CR comments
Zishan-7 Oct 10, 2025
beeb953
refactor: improve invite acceptance logic by adding error handling fo…
Zishan-7 Oct 10, 2025
f6f4154
fix: reset loading state on error in InitialClaimLinkView and handle …
Zishan-7 Oct 10, 2025
dbc0a61
refactor: dont shorten saved account titles
jjramirezn Oct 10, 2025
2c10e4c
Merge pull request #1314 from peanutprotocol/refactor/formatting-save…
jjramirezn Oct 10, 2025
51000ef
Merge pull request #1311 from peanutprotocol/fix/guest-invite-link
Hugo0 Oct 10, 2025
b321ae5
Merge remote-tracking branch 'origin/peanut-wallet' into feat/resolve…
Zishan-7 Oct 13, 2025
965d947
Merge pull request #1319 from peanutprotocol/feat/resolve-merge-conflict
kushagrasarathe Oct 13, 2025
c4b47eb
Update layout.tsx
Hugo0 Oct 13, 2025
ddcf18e
feat: comment out notification bell icon
Zishan-7 Oct 13, 2025
21b242b
Merge pull request #1320 from peanutprotocol/feat/hide-notif-icon
Hugo0 Oct 13, 2025
108d103
Update OG modal copy
Zishan-7 Oct 13, 2025
5dc591b
Merge pull request #1321 from peanutprotocol/feat/update-og-popup-copy
Hugo0 Oct 13, 2025
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
6 changes: 6 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,9 @@ export PROMO_LIST={}
export NEXT_PUBLIC_VAPID_PUBLIC_KEY=
export VAPID_PRIVATE_KEY=
export NEXT_PUBLIC_VAPID_SUBJECT="mailto:hello@peanut.to"
export NEXT_PUBLIC_FETCH_TIMEOUT_MS=10000

# one signal
export NEXT_PUBLIC_ONESIGNAL_APP_ID=
export NEXT_PUBLIC_SAFARI_WEB_ID=
export NEXT_PUBLIC_ONESIGNAL_WEBHOOK=
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@
"react-fast-marquee": "^1.6.5",
"react-ga4": "^2.1.0",
"react-hook-form": "^7.53.2",
"react-onesignal": "^3.2.3",
"react-qr-code": "^2.0.15",
"react-redux": "^9.2.0",
"react-tooltip": "^5.28.0",
Expand Down
319 changes: 165 additions & 154 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions public/arrows/top-right-arrow-2.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions public/onesignal/OneSignalSDKWorker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// use the stable v16 service worker path per onesignal docs
// note: onesignal does not publish minor-pinned sw paths; use v16 channel
importScripts('https://cdn.onesignal.com/sdks/web/v16/OneSignalSDK.sw.js')
Comment thread
Hugo0 marked this conversation as resolved.
83 changes: 60 additions & 23 deletions src/app/(mobile-ui)/home/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import PeanutLoading from '@/components/Global/PeanutLoading'
//import RewardsModal from '@/components/Global/RewardsModal'
import HomeHistory from '@/components/Home/HomeHistory'
//import RewardsCardModal from '@/components/Home/RewardsCardModal'
import { SearchUsers } from '@/components/SearchUsers'
import { UserHeader } from '@/components/UserHeader'
import { useAuth } from '@/context/authContext'
import { useWallet } from '@/hooks/wallet/useWallet'
Expand Down Expand Up @@ -38,13 +37,20 @@ import { PostSignupActionManager } from '@/components/Global/PostSignupActionMan
import { useWithdrawFlow } from '@/context/WithdrawFlowContext'
import { useClaimBankFlow } from '@/context/ClaimBankFlowContext'
import { useDeviceType, DeviceType } from '@/hooks/useGetDeviceType'
import SetupNotificationsModal from '@/components/Notifications/SetupNotificationsModal'
import { useNotifications } from '@/hooks/useNotifications'
import NotificationNavigation from '@/components/Notifications/NotificationNavigation'
import useKycStatus from '@/hooks/useKycStatus'
import HomeBanners from '@/components/Home/HomeBanners'
import InvitesIcon from '@/components/Home/InvitesIcon'
import NoMoreJailModal from '@/components/Global/NoMoreJailModal'
import EarlyUserModal from '@/components/Global/EarlyUserModal'

const BALANCE_WARNING_THRESHOLD = parseInt(process.env.NEXT_PUBLIC_BALANCE_WARNING_THRESHOLD ?? '500')
const BALANCE_WARNING_EXPIRY = parseInt(process.env.NEXT_PUBLIC_BALANCE_WARNING_EXPIRY ?? '1814400') // 21 days in seconds

export default function Home() {
const { showPermissionModal } = useNotifications()
const { balance, address, isFetchingBalance } = useWallet()
Comment on lines +53 to 54
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Don’t call useNotifications twice

useNotifications keeps its own React state. Calling it here creates a second, independent instance from the one inside SetupNotificationsModal. When the user dismisses the modal, only the modal’s instance flips showPermissionModal back to false; the Home-level instance stays true, so we keep rendering <SetupNotificationsModal /> (just invisible) and permanently suppress the add-money prompt (!showPermissionModal never becomes true again). Hoist the hook to a single owner (e.g., call it only in Home and pass the state/actions into the modal) or otherwise share the state (context/store).

🤖 Prompt for AI Agents
In src/app/(mobile-ui)/home/page.tsx around lines 53-54, you’re calling
useNotifications twice which creates two independent React states; remove the
extra hook usage and hoist the notifications state to a single owner by calling
useNotifications only in Home and passing the relevant values/actions
(showPermissionModal and any setters or handlers) as props into
SetupNotificationsModal (also update SetupNotificationsModal to accept and use
those props instead of calling useNotifications internally), or alternatively
wire the modal to a shared store/context so only one instance of the hook/state
exists.

const { resetFlow: resetClaimBankFlow } = useClaimBankFlow()
const { resetWithdrawFlow } = useWithdrawFlow()
Expand Down Expand Up @@ -186,28 +192,46 @@ export default function Home() {

// effect for showing add money prompt modal
useEffect(() => {
if (typeof window !== 'undefined' && !isFetchingBalance) {
const hasSeenAddMoneyPromptThisSession = sessionStorage.getItem('hasSeenAddMoneyPromptThisSession')

// show if:
// 1. balance is zero.
// 2. user hasn't seen this prompt in the current session.
// 3. the iOS PWA install modal is not currently active.
// 4. the balance warning modal is not currently active.
// this allows the modal on any device (iOS/Android) and in any display mode (PWA/browser),
// as long as the PWA modal (which is iOS & browser-specific) isn't taking precedence.
if (
balance === 0n &&
!hasSeenAddMoneyPromptThisSession &&
!showIOSPWAInstallModal &&
!showBalanceWarningModal &&
!isPostSignupActionModalVisible
) {
setShowAddMoneyPromptModal(true)
sessionStorage.setItem('hasSeenAddMoneyPromptThisSession', 'true')
}
if (typeof window === 'undefined' || isFetchingBalance || !user) return
const hasSeenAddMoneyPromptThisSession = sessionStorage.getItem('hasSeenAddMoneyPromptThisSession')
const showNoMoreJailModal = sessionStorage.getItem('showNoMoreJailModal')

// determine if we should show the add money modal based on all conditions
// show if:
// 1. balance is zero.
// 2. user hasn't seen this prompt in the current session.
// 3. setup notifications modal is not visible (priority: setup modal > add money prompt)
// 4. the iOS PWA install modal is not currently active.
// 5. the balance warning modal is not currently active.
// 6. no other post-signup modal is active
const shouldShow =
balance === 0n &&
!hasSeenAddMoneyPromptThisSession &&
!showPermissionModal &&
!showIOSPWAInstallModal &&
!showBalanceWarningModal &&
!isPostSignupActionModalVisible &&
showNoMoreJailModal !== 'true' &&
!user?.showEarlyUserModal // Give Early User and No more jail modal precedence, showing two modals together isn't ideal and it messes up their functionality

if (shouldShow) {
setShowAddMoneyPromptModal(true)
sessionStorage.setItem('hasSeenAddMoneyPromptThisSession', 'true')
} else if (showAddMoneyPromptModal && showPermissionModal) {
// priority enforcement: hide add money modal if notification modal appears
// this handles race conditions where both modals try to show simultaneously
setShowAddMoneyPromptModal(false)
}
}, [balance, isFetchingBalance, showIOSPWAInstallModal, showBalanceWarningModal])
}, [
balance,
isFetchingBalance,
showPermissionModal,
showIOSPWAInstallModal,
showBalanceWarningModal,
isPostSignupActionModalVisible,
showAddMoneyPromptModal,
user,
])

if (isLoading) {
return <PeanutLoading coverFullScreen />
Expand All @@ -218,7 +242,14 @@ export default function Home() {
<div className="h-full w-full space-y-6 p-5">
<div className="flex items-center justify-between gap-2">
<UserHeader username={username!} fullName={userFullName} isVerified={isUserKycApproved} />
<SearchUsers />
<div className="flex items-center">
<div className="flex items-center gap-2">
<Link href="/points">
<InvitesIcon />
</Link>
{/* <NotificationNavigation /> */}
</div>
</div>
</div>
<div className="space-y-4">
<ActionButtonGroup>
Expand Down Expand Up @@ -247,6 +278,8 @@ export default function Home() {

<HomeBanners />

{showPermissionModal && <SetupNotificationsModal />}

<HomeHistory username={username ?? undefined} />
{/* Render the new Rewards Modal
<RewardsModal />
Expand All @@ -262,6 +295,10 @@ export default function Home() {
{/* Add Money Prompt Modal */}
<AddMoneyPromptModal visible={showAddMoneyPromptModal} onClose={() => setShowAddMoneyPromptModal(false)} />

<NoMoreJailModal />

<EarlyUserModal />

{/* Balance Warning Modal */}
<BalanceWarningModal
visible={showBalanceWarningModal}
Expand Down
10 changes: 8 additions & 2 deletions src/app/(mobile-ui)/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,12 @@ import { twMerge } from 'tailwind-merge'
import '../../styles/globals.css'
import SupportDrawer from '@/components/Global/SupportDrawer'
import { useSupportModalContext } from '@/context/SupportModalContext'
import JoinWaitlistPage from '@/components/Invites/JoinWaitlistPage'
import { useRouter } from 'next/navigation'
import { Banner } from '@/components/Global/Banner'

// Allow access to some public paths without authentication
const publicPathRegex = /^\/(request\/pay|claim|pay\/.+$|support)/
const publicPathRegex = /^\/(request\/pay|claim|pay\/.+$|support|invite)/

const Layout = ({ children }: { children: React.ReactNode }) => {
const pathName = usePathname()
Expand Down Expand Up @@ -83,14 +84,19 @@ const Layout = ({ children }: { children: React.ReactNode }) => {
}
}, [user, isFetchingUser])

if (!isReady || (isFetchingUser && !user && !hasToken && !isPublicPath)) {
if (!isReady || isFetchingUser || (!hasToken && !isPublicPath) || (!isPublicPath && !user)) {
return (
<div className="flex h-[100dvh] w-full flex-col items-center justify-center">
<PeanutLoading />
</div>
)
}

// Show waitlist page if user doesn't have app access
if (!isFetchingUser && user && !user?.user.hasAppAccess && !isPublicPath) {
return <JoinWaitlistPage />
}

Comment thread
coderabbitai[bot] marked this conversation as resolved.
return (
<div className="flex min-h-[100dvh] w-full bg-background">
{/* Wrapper div for desktop layout */}
Expand Down
Loading
Loading