-
Notifications
You must be signed in to change notification settings - Fork 239
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
94 additions
and
55 deletions.
There are no files selected for viewing
This file contains 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 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 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 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
47 changes: 24 additions & 23 deletions
47
dashboard/src/main/home/project-settings/ReferralsPage.tsx
This file contains 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,36 @@ | ||
import React from "react"; | ||
|
||
import Link from "components/porter/Link"; | ||
import Spacer from "components/porter/Spacer"; | ||
import Text from "components/porter/Text"; | ||
import { useReferralDetails } from "lib/hooks/useStripe"; | ||
import Link from "components/porter/Link"; | ||
|
||
function ReferralsPage(): JSX.Element { | ||
const { referralDetails } = useReferralDetails(); | ||
const baseUrl = window.location.origin; | ||
const { referralDetails } = useReferralDetails(); | ||
const baseUrl = window.location.origin; | ||
|
||
return ( | ||
return ( | ||
<> | ||
<Text size={16}>Referrals</Text> | ||
<Spacer y={1} /> | ||
<Text color="helper">Refer people to Porter to earn credits.</Text> | ||
<Spacer y={1} /> | ||
{referralDetails !== null && ( | ||
<> | ||
<Text size={16}>Referrals</Text> | ||
<Spacer y={1} /> | ||
<Text color="helper"> | ||
Refer people to Porter to earn credits. | ||
</Text> | ||
<Spacer y={1} /> | ||
{referralDetails !== null && ( | ||
<> | ||
<Text> | ||
Your referral link is {" "} | ||
</Text> | ||
<Link to={baseUrl + "/register?referral=" + referralDetails.code}>{baseUrl + "/register?referral=" + referralDetails.code}</Link> | ||
<Spacer y={1} /> | ||
<Text>You have referred {referralDetails.referral_count} users</Text> | ||
</> | ||
|
||
)} | ||
<Spacer y={1} /> | ||
<Text>Your referral link is </Text> | ||
<Link to={baseUrl + "/register?referral=" + referralDetails.code}> | ||
{baseUrl + "/register?referral=" + referralDetails.code} | ||
</Link> | ||
<Spacer y={1} /> | ||
<Text> | ||
You have referred {referralDetails.referral_count}/ | ||
{referralDetails.max_allowed_referrals} users | ||
</Text> | ||
</> | ||
) | ||
)} | ||
<Spacer y={1} /> | ||
</> | ||
); | ||
} | ||
|
||
export default ReferralsPage; |
This file contains 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