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

fix: remove referrals feature flag #161

Merged
merged 2 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
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
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
Loading