Skip to content

Commit

Permalink
feat: add life-time tier
Browse files Browse the repository at this point in the history
  • Loading branch information
aalemayhu authored Oct 12, 2024
1 parent 2669345 commit 88e7f72
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getSubscribeLink } from '../../../../PricingPage/getSubscribeLink';
import { getSubscribeLink } from '../../../../PricingPage/payment.links';
import { TierInfoColumn } from './TierInfoColumn';
import { useIsLoggedIn } from '../../../../../lib/useIsLoggedIn';

Expand Down
7 changes: 6 additions & 1 deletion src/pages/PricingPage/PricingPage.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
import { PageContainer } from '../../components/styled';
import { getVisibleText } from '../../lib/text/getVisibleText';
import { getSubscribeLink } from './getSubscribeLink';
import { getLifetimeLink, getSubscribeLink } from './payment.links';
import { PricingCard } from './components/PricingCard';
import TopMessage from '../../components/TopMessage/TopMessage';
import { useIsLoggedIn } from '../../lib/useIsLoggedIn';

export default function PricingPage() {
const isLoggedIn = useIsLoggedIn();
const subcribeLink = isLoggedIn ? getSubscribeLink() : '/login';
const lifetimeLink = isLoggedIn ? getLifetimeLink() : '/login';

return (
<PageContainer>
Expand Down Expand Up @@ -35,6 +36,10 @@ export default function PricingPage() {
<PricingCard price="$2" title="Subscriber Plan" benefits={['Unlimited Flashcards (9GB++)']}
link={subcribeLink} linkText="Subscribe" />
</div>
<div className="column is-4">
<PricingCard price="$96" title="Lifetime Access" benefits={['Forever premium access to 2anki.net']}
link={lifetimeLink} linkText="Buy" />
</div>
</div>
</div>
</section>
Expand Down
4 changes: 1 addition & 3 deletions src/pages/PricingPage/components/PricingCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,7 @@ export function PricingCard({ price, title, benefits, linkText, link }: Readonly
</div>
<div className="card-content">
<div className="content">
<ul>
{benefits.map((benefit) => (<li key={benefit}>{benefit}</li>))}
</ul>
{benefits.map((benefit) => (<p key={benefit}>{benefit}</p>))}
</div>
</div>
{link && linkText && <div className="card-footer">
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,8 @@ export const getSubscribeLink = () =>
process.env.NODE_ENV === 'development' ?
'https://buy.stripe.com/test_fZebM83k00Rj6PeeUU' :
'https://buy.stripe.com/cN2cPC6ek7RCbjGdQU';

export const getLifetimeLink = () =>
process.env.NODE_ENV === 'development' ?
'https://buy.stripe.com/test_14kbM82fW43v6PeeUV' :
'https://buy.stripe.com/28obLyeKQ3BmcnK8wB';

0 comments on commit 88e7f72

Please sign in to comment.