-
Notifications
You must be signed in to change notification settings - Fork 13
Invites QA fixes #1293
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
Invites QA fixes #1293
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
08fafed
add 1 second delay in login flow
Zishan-7 0027be7
refactor: add readiness check before redirecting in layout and remove…
Zishan-7 a4d8c87
fix: update isLoading to isFetching in useUserQuery for consistency
Zishan-7 5bb8f9c
fix: user has to login twice
Zishan-7 fa8c627
feat: add no more jail modal
Zishan-7 47a1e18
update invites icon animation
Zishan-7 3e1e1e3
feat: add early user modal
Zishan-7 d84fed1
refactor: move sessionStorage check inside useEffect for NoMoreJailModal
Zishan-7 02162da
feat: enhance LockIcon component to accept props for better customiza…
Zishan-7 5b33ba8
fixes and improvements
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
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,52 @@ | ||
| 'use client' | ||
| import { useEffect, useState } from 'react' | ||
| import ActionModal from '../ActionModal' | ||
| import ShareButton from '../ShareButton' | ||
| import { generateInviteCodeLink, generateInvitesShareText } from '@/utils' | ||
| import { useAuth } from '@/context/authContext' | ||
| import { updateUserById } from '@/app/actions/users' | ||
|
|
||
| const EarlyUserModal = () => { | ||
| const { user } = useAuth() | ||
| const inviteLink = generateInviteCodeLink(user?.user.username ?? '').inviteLink | ||
| const [showModal, setShowModal] = useState(false) | ||
|
|
||
| useEffect(() => { | ||
| if (user && user.showEarlyUserModal) { | ||
| setShowModal(true) | ||
| } | ||
| }, [user]) | ||
|
|
||
| const handleCloseModal = () => { | ||
| setShowModal(false) | ||
| updateUserById({ userId: user?.user.userId, hasSeenEarlyUserModal: true }) | ||
| } | ||
|
|
||
| return ( | ||
| <ActionModal | ||
| icon="lock" | ||
| title="You’re part of the first crew" | ||
| visible={showModal} | ||
| onClose={handleCloseModal} | ||
| content={ | ||
| <> | ||
| <p className="text-sm text-grey-1"> | ||
| Peanut is now <b>invite-only.</b> | ||
| <br /> | ||
| As an <b>early user</b>, you keep full access and you get the power to invite friends. | ||
| <br /> | ||
| Each invite earns you <b>points</b> and perks. | ||
| </p> | ||
| <ShareButton | ||
| generateText={() => Promise.resolve(generateInvitesShareText(inviteLink))} | ||
| title="Share your invite link" | ||
| > | ||
| Share Invite link | ||
| </ShareButton> | ||
| </> | ||
| } | ||
| /> | ||
| ) | ||
| } | ||
|
|
||
| export default EarlyUserModal |
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,19 @@ | ||
| import { FC, SVGProps } from 'react' | ||
|
|
||
| export const LockIcon: FC<SVGProps<SVGSVGElement>> = (props) => { | ||
| return ( | ||
| <svg | ||
| width="16" | ||
| height="20" | ||
| viewBox="0 0 16 20" | ||
| fill="currentColor" | ||
| xmlns="http://www.w3.org/2000/svg" | ||
| {...props} | ||
| > | ||
| <path | ||
| d="M13.4286 6.83333H12.5239V5.02381C12.5239 2.52667 10.4972 0.5 8.00006 0.5C5.50292 0.5 3.47625 2.52667 3.47625 5.02381V6.83333H2.57149C1.57625 6.83333 0.761963 7.64762 0.761963 8.64286V17.6905C0.761963 18.6857 1.57625 19.5 2.57149 19.5H13.4286C14.4239 19.5 15.2382 18.6857 15.2382 17.6905V8.64286C15.2382 7.64762 14.4239 6.83333 13.4286 6.83333ZM5.28577 5.02381C5.28577 3.5219 6.49815 2.30952 8.00006 2.30952C9.50196 2.30952 10.7143 3.5219 10.7143 5.02381V6.83333H5.28577V5.02381ZM13.4286 17.6905H2.57149V8.64286H13.4286V17.6905ZM8.00006 14.9762C8.9953 14.9762 9.80958 14.1619 9.80958 13.1667C9.80958 12.1714 8.9953 11.3571 8.00006 11.3571C7.00482 11.3571 6.19053 12.1714 6.19053 13.1667C6.19053 14.1619 7.00482 14.9762 8.00006 14.9762Z" | ||
| fill="currentColor" | ||
| /> | ||
| </svg> | ||
| ) | ||
| } |
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,71 @@ | ||
| 'use client' | ||
| import React, { FC, useEffect, useState } from 'react' | ||
| import Image from 'next/image' | ||
| import { PEANUT_LOGO_BLACK, PEANUTMAN_LOGO } from '@/assets' | ||
| import Modal from '../Modal' | ||
| import { Button } from '@/components/0_Bruddle' | ||
| import chillPeanutAnim from '@/animations/GIF_ALPHA_BACKGORUND/512X512_ALPHA_GIF_konradurban_01.gif' | ||
|
|
||
| const NoMoreJailModal = () => { | ||
| const [isOpen, setisOpen] = useState(false) | ||
|
|
||
| const onClose = () => { | ||
| setisOpen(false) | ||
| sessionStorage.removeItem('showNoMoreJailModal') | ||
| } | ||
|
|
||
| useEffect(() => { | ||
| const showNoMoreJailModal = sessionStorage.getItem('showNoMoreJailModal') | ||
| if (showNoMoreJailModal === 'true') { | ||
| setisOpen(true) | ||
| } | ||
| }, []) | ||
|
|
||
| return ( | ||
| <Modal | ||
| hideOverlay | ||
| visible={isOpen} | ||
| onClose={onClose} | ||
| className="items-center rounded-none md:mx-auto md:max-w-md" | ||
| classWrap="sm:m-auto sm:self-center self-center m-4 bg-background rounded-none border-0" | ||
| > | ||
| {/* Main content container */} | ||
| <div className="relative z-10 w-full rounded-md bg-white px-6 py-6"> | ||
| <div className="space-y-4"> | ||
| <div className="space-y-3 text-center"> | ||
| <div className="w-full space-y-2"> | ||
| <h3 className={'text-xl font-extrabold text-black dark:text-white'}> | ||
| No more Peanut jail! | ||
| </h3> | ||
|
|
||
| <div className="text-sm text-grey-1 dark:text-white"> | ||
| <p> | ||
| You’re now part of Peanut! | ||
| <br /> | ||
| Explore, pay, and invite your friends. | ||
| </p> | ||
| </div> | ||
| </div> | ||
| </div> | ||
|
|
||
| <Button className="w-full" shadowSize="4" variant="purple" onClick={onClose}> | ||
| <div>Start using</div> | ||
| <div className="flex items-center gap-1"> | ||
| <Image src={PEANUTMAN_LOGO} alt="Peanut Logo" className="size-5" /> | ||
| <Image src={PEANUT_LOGO_BLACK} alt="Peanut Logo" /> | ||
| </div> | ||
| </Button> | ||
| </div> | ||
| </div> | ||
|
|
||
| {/* Peanutman animation */} | ||
| <div className="absolute left-0 top-7 flex w-full justify-center" style={{ transform: 'translateY(-80%)' }}> | ||
| <div className="relative h-42 w-[90%] md:h-52"> | ||
| <Image src={chillPeanutAnim.src} alt="Peanut Man" className="object-contain" fill /> | ||
| </div> | ||
| </div> | ||
| </Modal> | ||
| ) | ||
| } | ||
|
|
||
| export default NoMoreJailModal |
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 |
|---|---|---|
| @@ -1,35 +1,8 @@ | ||
| import STAR_STRAIGHT_ICON from '@/assets/icons/starStraight.svg' | ||
| import Image from 'next/image' | ||
| import { motion } from 'framer-motion' | ||
|
|
||
| const InvitesIcon = () => { | ||
| return ( | ||
| <motion.div | ||
| animate={{ | ||
| rotate: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -15, 15, -10, 10, -5, 0], | ||
| y: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -2, 0, -1, 0, -1, 0], | ||
| }} | ||
| transition={{ | ||
| duration: 10, | ||
| repeat: Infinity, | ||
| ease: 'easeInOut', | ||
| }} | ||
| whileHover={{ | ||
| scale: 1.3, | ||
| rotate: 20, | ||
| transition: { duration: 0.3, ease: 'easeOut' }, | ||
| }} | ||
| whileTap={{ | ||
| scale: 0.9, | ||
| transition: { duration: 0.1 }, | ||
| }} | ||
| style={{ | ||
| transition: 'transform 0.3s ease-out', | ||
| }} | ||
| > | ||
| <Image src={STAR_STRAIGHT_ICON} alt="star" width={20} height={20} /> | ||
| </motion.div> | ||
| ) | ||
| return <Image className="animate-pulsate-slow" src={STAR_STRAIGHT_ICON} alt="star" width={20} height={20} /> | ||
| } | ||
|
|
||
| export default InvitesIcon |
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
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.