2022-07-21 19:43:10 +00:00
|
|
|
import { Col } from 'web/components/layout/col'
|
|
|
|
import { SEO } from 'web/components/SEO'
|
|
|
|
import { Title } from 'web/components/title'
|
|
|
|
import { useUser } from 'web/hooks/use-user'
|
|
|
|
import { Page } from 'web/components/page'
|
|
|
|
import { useTracking } from 'web/hooks/use-tracking'
|
|
|
|
import { redirectIfLoggedOut } from 'web/lib/firebase/server-auth'
|
|
|
|
import { CopyLinkButton } from 'web/components/copy-link-button'
|
|
|
|
import { ENV_CONFIG } from 'common/envs/constants'
|
|
|
|
import { InfoBox } from 'web/components/info-box'
|
2022-08-09 17:27:52 +00:00
|
|
|
import { QRCode } from 'web/components/qr-code'
|
2022-08-22 05:37:26 +00:00
|
|
|
import { REFERRAL_AMOUNT } from 'common/economy'
|
2022-10-09 23:09:21 +00:00
|
|
|
import { formatMoney } from 'common/util/format'
|
2022-07-21 19:43:10 +00:00
|
|
|
|
|
|
|
export const getServerSideProps = redirectIfLoggedOut('/')
|
|
|
|
|
|
|
|
export default function ReferralsPage() {
|
|
|
|
const user = useUser()
|
|
|
|
|
|
|
|
useTracking('view referrals')
|
|
|
|
|
|
|
|
const url = `https://${ENV_CONFIG.domain}?referrer=${user?.username}`
|
|
|
|
|
|
|
|
return (
|
|
|
|
<Page>
|
2022-07-22 16:25:48 +00:00
|
|
|
<SEO
|
2022-10-09 23:09:21 +00:00
|
|
|
title="Refer a friend"
|
2022-10-09 23:10:02 +00:00
|
|
|
description={`Invite new users to Manifold and get ${formatMoney(
|
|
|
|
REFERRAL_AMOUNT
|
|
|
|
)} if they
|
2022-07-22 16:25:48 +00:00
|
|
|
sign up!`}
|
|
|
|
url="/referrals"
|
|
|
|
/>
|
2022-07-21 19:43:10 +00:00
|
|
|
|
|
|
|
<Col className="items-center">
|
|
|
|
<Col className="h-full rounded bg-white p-4 py-8 sm:p-8 sm:shadow-md">
|
2022-10-09 23:09:21 +00:00
|
|
|
<Title className="!mt-0" text="Refer a friend" />
|
2022-07-21 19:43:10 +00:00
|
|
|
<img
|
|
|
|
className="mb-6 block -scale-x-100 self-center"
|
|
|
|
src="/logo-flapping-with-money.gif"
|
|
|
|
width={200}
|
|
|
|
height={200}
|
|
|
|
/>
|
|
|
|
|
|
|
|
<div className={'mb-4'}>
|
2022-10-09 23:10:02 +00:00
|
|
|
Invite new users to Manifold and get {formatMoney(REFERRAL_AMOUNT)}{' '}
|
|
|
|
if they sign up!
|
2022-07-21 19:43:10 +00:00
|
|
|
</div>
|
|
|
|
|
|
|
|
<CopyLinkButton
|
|
|
|
url={url}
|
|
|
|
tracking="copy referral link"
|
2022-10-12 19:27:17 +00:00
|
|
|
buttonClassName="rounded-l-none"
|
2022-07-21 19:43:10 +00:00
|
|
|
toastClassName={'-left-28 mt-1'}
|
|
|
|
/>
|
|
|
|
|
2022-08-09 17:27:52 +00:00
|
|
|
<QRCode url={url} className="mt-4 self-center" />
|
|
|
|
|
2022-07-21 19:43:10 +00:00
|
|
|
<InfoBox
|
|
|
|
title="FYI"
|
|
|
|
className="mt-4 max-w-md"
|
2022-07-25 05:50:33 +00:00
|
|
|
text="You can also earn the referral bonus using the share link to any market or group!"
|
2022-07-21 19:43:10 +00:00
|
|
|
/>
|
|
|
|
</Col>
|
|
|
|
</Col>
|
|
|
|
</Page>
|
|
|
|
)
|
|
|
|
}
|