-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #660 from pokt-foundation/pricing-update
Pricing update
- Loading branch information
Showing
14 changed files
with
9,572 additions
and
7,567 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
60 changes: 60 additions & 0 deletions
60
app/routes/account.$accountId.settings.plan/components/FreeAccountPlan/FreeAccountPlan.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 |
---|---|---|
@@ -0,0 +1,60 @@ | ||
import { SimpleGrid, Stack, Text, Title } from "@mantine/core" | ||
import { useNavigate } from "@remix-run/react" | ||
import React from "react" | ||
import { AccountPlan } from "~/components/AccountPlan" | ||
import { Account, PayPlanType, RoleName } from "~/models/portal/sdk" | ||
import FreePlanLimitCard from "~/routes/account.$accountId.settings.plan/components/FreePlanLimitCard" | ||
import { AnalyticActions, AnalyticCategories, trackEvent } from "~/utils/analytics" | ||
import { getPlanName } from "~/utils/planUtils" | ||
|
||
type FreeAccountPlanProps = { | ||
account: Account | ||
userRole: RoleName | ||
} | ||
|
||
const FreeAccountPlan = ({ account, userRole }: FreeAccountPlanProps) => { | ||
const navigate = useNavigate() | ||
|
||
return userRole === "MEMBER" ? ( | ||
<Stack mt={"xl"}> | ||
<FreePlanLimitCard account={account} /> | ||
</Stack> | ||
) : ( | ||
<Stack align="center" mt={"xl"}> | ||
<Stack gap="xs" ta="center"> | ||
<Title order={3}>Upgrade your plan</Title> | ||
<Text> | ||
Your current plan is {getPlanName(account.planType)}. <br /> Upgrade now to | ||
Unlimited. | ||
</Text> | ||
</Stack> | ||
<SimpleGrid cols={{ base: 1, lg: 3 }}> | ||
<AccountPlan disableFree type={PayPlanType.PlanFree} /> | ||
<AccountPlan | ||
type={PayPlanType.PlanUnlimited} | ||
onContinue={() => { | ||
trackEvent({ | ||
category: AnalyticCategories.account, | ||
action: AnalyticActions.account_plan_upgrade, | ||
label: account.id, | ||
}) | ||
navigate(`/api/stripe/checkout-session?account-id=${account.id}`) | ||
}} | ||
/> | ||
<AccountPlan | ||
type={PayPlanType.Enterprise} | ||
onContinue={() => { | ||
trackEvent({ | ||
category: AnalyticCategories.account, | ||
action: AnalyticActions.account_plan_enterprise, | ||
label: account.id, | ||
}) | ||
window.open("https://www.grove.city/enterprise", "_blank", "noreferrer") | ||
}} | ||
/> | ||
</SimpleGrid> | ||
</Stack> | ||
) | ||
} | ||
|
||
export default FreeAccountPlan |
3 changes: 3 additions & 0 deletions
3
app/routes/account.$accountId.settings.plan/components/FreeAccountPlan/index.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FreeAccountPlan from "./FreeAccountPlan" | ||
export * from "./FreeAccountPlan" | ||
export default FreeAccountPlan |
39 changes: 39 additions & 0 deletions
39
...outes/account.$accountId.settings.plan/components/FreePlanLimitCard/FreePlanLimitCard.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 |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { Divider, Group, Text, Stack } from "@mantine/core" | ||
import React from "react" | ||
import { TitledCard } from "~/components/TitledCard" | ||
import { Account } from "~/models/portal/sdk" | ||
import { getPlanName } from "~/utils/planUtils" | ||
|
||
type FreePlanLimitCardProps = { | ||
account: Account | ||
} | ||
|
||
export const FreePlanLimitCard = ({ account }: FreePlanLimitCardProps) => { | ||
const cardItems = [ | ||
{ | ||
label: "Plan Type", | ||
value: getPlanName(account.planType), | ||
}, | ||
// { | ||
// label: "Daily Limit", | ||
// value: account.integrations.dailyLimit, | ||
// }, | ||
] | ||
|
||
return ( | ||
<TitledCard header={() => <Text fw={600}>Current plan</Text>}> | ||
<Stack px={20} py={10}> | ||
{cardItems.map(({ label, value }, index) => ( | ||
<React.Fragment key={`${label}-${index}`}> | ||
<Group justify="space-between" p={12}> | ||
<Text>{label}</Text> <Text>{value}</Text> | ||
</Group> | ||
{index !== cardItems.length - 1 && <Divider />} | ||
</React.Fragment> | ||
))} | ||
</Stack> | ||
</TitledCard> | ||
) | ||
} | ||
|
||
export default FreePlanLimitCard |
3 changes: 3 additions & 0 deletions
3
app/routes/account.$accountId.settings.plan/components/FreePlanLimitCard/index.ts
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
import FreePlanLimitCard from "./FreePlanLimitCard" | ||
export * from "./FreePlanLimitCard" | ||
export default FreePlanLimitCard |
Oops, something went wrong.