-
Notifications
You must be signed in to change notification settings - Fork 13
[TASK-14876] Feat/invites #1251
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
Merged
Merged
Changes from all commits
Commits
Show all changes
50 commits
Select commit
Hold shift + click to select a range
35c3720
Invites UI
Zishan-7 306b263
add basic API integration
Zishan-7 6046db0
update flow and integrate valid Invite code check
Zishan-7 10d2fd7
feat: integrate waitlist logic
Zishan-7 9e7bcc8
feat: integrate /invites page
Zishan-7 54e298e
integrate payment link invites
Zishan-7 6d430da
Add copy invite logic
Zishan-7 9a9b0da
add collect email flow
Zishan-7 67cd406
fix: bugs and fixes
Zishan-7 9118f50
fix: improve user access checks and update image import in ActionList
Zishan-7 0ecd8f0
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 5d26f18
fix: add missing dependency
Zishan-7 f08a31c
fix: build error
Zishan-7 fcec045
fix: enhance username handling in ActionList and improve error handli…
Zishan-7 d76a524
refactor: simplify layout component by removing conditional rendering…
Zishan-7 8ef5110
add widdge animation
Zishan-7 9f6bd9c
fix nits and bugs
Zishan-7 85e098a
refactor: replace CopyToClipboardButton with CopyToClipboard component
Zishan-7 eaaf636
create invite interface
Zishan-7 e15f64b
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 bbb5272
Add payment invite type
Zishan-7 2911337
fix: minor bug and fixes
Zishan-7 3464c01
improve error handling
Zishan-7 6bb4c7b
update animation
Zishan-7 0a68369
update animation
Zishan-7 bb39196
refactor: replace star icon animation with InvitesIcon component and …
Zishan-7 ed23e30
fix: undefined user error
Zishan-7 6203071
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 570656f
fix: undefined user error
Zishan-7 e785ae0
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 5f8d924
fix: UI bugs and Dont lose invite not showing on daimo method
Zishan-7 ed5c25d
feat: add showConfirmModal prop to ActionListDaimoPayButton for invit…
Zishan-7 4ae9427
feat: add error handling for invite code validation in JoinWaitlist c…
Zishan-7 14009c8
fix: claim route not working
Zishan-7 08dd943
refactor: remove inviteCode dependency from useEffect in SetupLayoutC…
Zishan-7 f8dfbc0
Fix: browser not supported error on mobile
Zishan-7 a2616cc
Remove `Refer` text
Zishan-7 a3c38fa
design updates
Zishan-7 69cde04
fix: email error message
Zishan-7 632635e
fix: home screen flashes before logout
Zishan-7 0ee0f27
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 0e4fa50
add social preview
Zishan-7 4eddeaa
remove logs
Zishan-7 e89dca0
fix: bugs
Zishan-7 94f1154
update social preview description
Zishan-7 207142a
add peanutman logo on top of modal
Zishan-7 1c295fc
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 1228144
coderrabit suggestions
Zishan-7 6891653
refactor: remove unused selectedStep variable and clean up dependenci…
Zishan-7 8e3adb0
Merge remote-tracking branch 'origin/peanut-wallet-dev' into feat/inv…
Zishan-7 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
'use server' | ||
|
||
import { PEANUT_API_URL } from '@/constants' | ||
import { fetchWithSentry } from '@/utils' | ||
|
||
const API_KEY = process.env.PEANUT_API_KEY! | ||
|
||
export async function validateInviteCode( | ||
inviteCode: string | ||
): Promise<{ data?: { success: boolean; username: string }; error?: string }> { | ||
const apiUrl = PEANUT_API_URL | ||
|
||
if (!apiUrl || !API_KEY) { | ||
console.error('API URL or API Key is not configured.') | ||
return { error: 'Server configuration error.' } | ||
} | ||
|
||
try { | ||
const response = await fetchWithSentry(`${apiUrl}/invites/validate`, { | ||
method: 'POST', | ||
headers: { | ||
'Content-Type': 'application/json', | ||
'api-key': API_KEY, | ||
}, | ||
body: JSON.stringify({ inviteCode }), | ||
}) | ||
|
||
if (!response.ok) { | ||
const data = await response.json() | ||
return { error: data.error || 'Failed to validate invite code.' } | ||
} | ||
|
||
const data = await response.json() | ||
|
||
return { data: { success: true, username: data.username } } | ||
Zishan-7 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
} catch (error) { | ||
console.error('Error calling validate invite code API:', error) | ||
if (error instanceof Error) { | ||
return { error: error.message } | ||
} | ||
return { error: 'An unexpected error occurred.' } | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.