Skip to content

Commit

Permalink
fix: remove referrals feature flag (#161)
Browse files Browse the repository at this point in the history
also add a way to hide the plan page after Stripe checkout to fix an
annoying signup flow issue - will need to update Stripe to fully take
advantage of this
  • Loading branch information
travis authored Dec 13, 2024
1 parent 6794d0f commit d504602
Showing 1 changed file with 27 additions and 34 deletions.
61 changes: 27 additions & 34 deletions src/app/settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { GB, TB, filesize } from '@/lib'
import DefaultLoader from '@/components/Loader'
import { RefcodeLink, ReferralsList, RefcodeCreator } from '../referrals/page'
import { useReferrals } from '@/lib/referrals/hooks'
import { useSearchParams } from 'next/navigation'

const Plans: Record<`did:${string}`, { name: string, limit: number }> = {
'did:web:starter.web3.storage': { name: 'Starter', limit: 5 * GB },
Expand Down Expand Up @@ -75,43 +74,37 @@ export default function SettingsPage (): JSX.Element {
// TODO: need to calculate these from the referral information that gets added during the TBD cronjob
const credits = 0
const points = 0
const params = useSearchParams()
const referralsEnabled = (params.get('referrals') === 'enabled')
return (
<>
<SettingsNav />
<H1>Settings</H1>
{referralsEnabled && (
<>
<H2>Rewards</H2>
<div className='flex flex-row space-x-2 justify-between max-w-4xl mb-4'>
<div className='border border-hot-red rounded-2xl bg-white p-5 flex-grow'>
<H3>Referred</H3>
<span className='text-4xl'>{referred}</span> / {MAX_REFERRALS}
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 flex-grow'>
<H3>USD Credits</H3>
<span className='text-4xl'>{credits}</span> / {MAX_CREDITS}
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 flex-grow'>
<H3>Racha Points</H3>
<span className='text-4xl'>{points}</span>
</div>
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 max-w-4xl mb-4'>
<ReferralsList />
{referralLink ? (
<RefcodeLink referralLink={referralLink} />
) : (
<RefcodeCreator
accountEmail={accountEmail}
urlQueryEmail={urlQueryEmail}
createRefcode={createRefcode}
mutateRefcode={mutateRefcode}
setReferrerEmail={setReferrerEmail} />)}
</div>
</>
)}
<H2>Rewards</H2>
<div className='flex flex-row space-x-2 justify-between max-w-4xl mb-4'>
<div className='border border-hot-red rounded-2xl bg-white p-5 flex-grow'>
<H3>Referred</H3>
<span className='text-4xl'>{referred}</span> / {MAX_REFERRALS}
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 flex-grow'>
<H3>USD Credits</H3>
<span className='text-4xl'>{credits}</span> / {MAX_CREDITS}
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 flex-grow'>
<H3>Racha Points</H3>
<span className='text-4xl'>{points}</span>
</div>
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 max-w-4xl mb-4'>
<ReferralsList />
{referralLink ? (
<RefcodeLink referralLink={referralLink} />
) : (
<RefcodeCreator
accountEmail={accountEmail}
urlQueryEmail={urlQueryEmail}
createRefcode={createRefcode}
mutateRefcode={mutateRefcode}
setReferrerEmail={setReferrerEmail} />)}
</div>
<div className='border border-hot-red rounded-2xl bg-white p-5 max-w-4xl'>
<H2>Plan</H2>
<p className='font-epilogue mb-4'>
Expand Down

0 comments on commit d504602

Please sign in to comment.