Skip to content

Commit 0a526a5

Browse files
committed
Add premium badge
1 parent 23af058 commit 0a526a5

File tree

3 files changed

+36
-5
lines changed

3 files changed

+36
-5
lines changed

site/src/components/Badges/Badges.tsx

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,23 @@ export const EnterpriseBadge: FC = () => {
123123
);
124124
};
125125

126+
export const PremiumBadge: FC = () => {
127+
return (
128+
<span
129+
css={[
130+
styles.badge,
131+
(theme) => ({
132+
backgroundColor: theme.roles.info.background,
133+
border: `1px solid ${theme.roles.info.outline}`,
134+
color: theme.roles.info.text,
135+
}),
136+
]}
137+
>
138+
Premium
139+
</span>
140+
);
141+
};
142+
126143
export const PreviewBadge: FC = () => {
127144
return (
128145
<span

site/src/components/Paywall/PopoverPaywall.stories.tsx

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,19 @@ const meta: Meta<typeof PopoverPaywall> = {
99
export default meta;
1010
type Story = StoryObj<typeof PopoverPaywall>;
1111

12-
const Example: Story = {
12+
export const Enterprise: Story = {
1313
args: {
1414
message: "Black Lotus",
1515
description:
1616
"Adds 3 mana of any single color of your choice to your mana pool, then is discarded. Tapping this artifact can be played as an interrupt.",
1717
},
1818
};
1919

20-
export { Example as PopoverPaywall };
20+
export const Premium: Story = {
21+
args: {
22+
message: "Black Lotus",
23+
description:
24+
"Adds 3 mana of any single color of your choice to your mana pool, then is discarded. Tapping this artifact can be played as an interrupt.",
25+
licenseType: "premium",
26+
},
27+
};

site/src/components/Paywall/PopoverPaywall.tsx

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,29 @@ import TaskAltIcon from "@mui/icons-material/TaskAlt";
33
import Button from "@mui/material/Button";
44
import Link from "@mui/material/Link";
55
import type { FC, ReactNode } from "react";
6-
import { EnterpriseBadge } from "components/Badges/Badges";
6+
import { EnterpriseBadge, PremiumBadge } from "components/Badges/Badges";
77
import { Stack } from "components/Stack/Stack";
88
import { docs } from "utils/docs";
99

1010
export interface PopoverPaywallProps {
1111
message: string;
1212
description?: ReactNode;
1313
documentationLink?: string;
14+
licenseType?: "enterprise" | "premium";
1415
}
1516

1617
export const PopoverPaywall: FC<PopoverPaywallProps> = ({
1718
message,
1819
description,
1920
documentationLink,
21+
licenseType = "enterprise",
2022
}) => {
2123
return (
2224
<div css={styles.root}>
2325
<div>
2426
<Stack direction="row" alignItems="center" css={{ marginBottom: 18 }}>
2527
<h5 css={styles.title}>{message}</h5>
26-
<EnterpriseBadge />
28+
{licenseType === "premium" ? <PremiumBadge /> : <EnterpriseBadge />}
2729
</Stack>
2830

2931
{description && <p css={styles.description}>{description}</p>}
@@ -51,6 +53,11 @@ export const PopoverPaywall: FC<PopoverPaywallProps> = ({
5153
<li css={styles.feature}>
5254
<FeatureIcon /> Audit logs
5355
</li>
56+
{licenseType === "premium" && (
57+
<li css={styles.feature}>
58+
<FeatureIcon /> Organizations
59+
</li>
60+
)}
5461
</ul>
5562
<Button
5663
href={docs("/enterprise")}
@@ -60,7 +67,7 @@ export const PopoverPaywall: FC<PopoverPaywallProps> = ({
6067
variant="outlined"
6168
color="neutral"
6269
>
63-
Learn about Enterprise
70+
Learn about {licenseType === "premium" ? "Premium" : "Enterprise"}
6471
</Button>
6572
</Stack>
6673
</div>

0 commit comments

Comments
 (0)