Skip to content

Commit c58db86

Browse files
committed
Add premium badge
1 parent eb9318c commit c58db86

File tree

16 files changed

+68
-37
lines changed

16 files changed

+68
-37
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>

site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@ import {
1616
PopoverContent,
1717
PopoverTrigger,
1818
} from "components/Popover/Popover";
19-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
2019
import { getFormHelpers } from "utils/formUtils";
2120
import { Fieldset } from "../Fieldset";
21+
import { Header } from "../Header";
2222
import { AnnouncementBannerSettings } from "./AnnouncementBannerSettings";
2323

2424
export type AppearanceSettingsPageViewProps = {
@@ -54,7 +54,7 @@ export const AppearanceSettingsPageView: FC<
5454

5555
return (
5656
<>
57-
<SettingsHeader
57+
<Header
5858
title="Appearance"
5959
description="Customize the look and feel of your Coder deployment."
6060
/>

site/src/pages/DeploySettingsPage/ExternalAuthSettingsPage/ExternalAuthSettingsPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import type { FC } from "react";
99
import type { DeploymentValues, ExternalAuthConfig } from "api/typesGenerated";
1010
import { Alert } from "components/Alert/Alert";
1111
import { EnterpriseBadge } from "components/Badges/Badges";
12-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
1312
import { docs } from "utils/docs";
13+
import { Header } from "../Header";
1414

1515
export type ExternalAuthSettingsPageViewProps = {
1616
config: DeploymentValues;
@@ -21,7 +21,7 @@ export const ExternalAuthSettingsPageView: FC<
2121
> = ({ config }) => {
2222
return (
2323
<>
24-
<SettingsHeader
24+
<Header
2525
title="External Authentication"
2626
description="Coder integrates with GitHub, GitLab, BitBucket, Azure Repos, and OpenID Connect to authenticate developers with external services."
2727
docsHref={docs("/admin/external-auth")}

site/src/pages/DeploySettingsPage/GeneralSettingsPage/GeneralSettingsPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@ import {
1111
ActiveUsersTitle,
1212
} from "components/ActiveUserChart/ActiveUserChart";
1313
import { ErrorAlert } from "components/Alert/ErrorAlert";
14-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
1514
import { Stack } from "components/Stack/Stack";
1615
import { useDeploymentOptions } from "utils/deployOptions";
1716
import { docs } from "utils/docs";
1817
import { Alert } from "../../../components/Alert/Alert";
18+
import { Header } from "../Header";
1919
import OptionsTable from "../OptionsTable";
2020
import { ChartSection } from "./ChartSection";
2121

@@ -38,7 +38,7 @@ export const GeneralSettingsPageView: FC<GeneralSettingsPageViewProps> = ({
3838
}) => {
3939
return (
4040
<>
41-
<SettingsHeader
41+
<Header
4242
title="General"
4343
description="Information about your Coder deployment."
4444
docsHref={docs("/admin/configure")}

site/src/components/SettingsHeader/SettingsHeader.tsx renamed to site/src/pages/DeploySettingsPage/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface HeaderProps {
1111
docsHref?: string;
1212
}
1313

14-
export const SettingsHeader: FC<HeaderProps> = ({
14+
export const Header: FC<HeaderProps> = ({
1515
title,
1616
description,
1717
docsHref,

site/src/pages/DeploySettingsPage/LicensesSettingsPage/AddNewLicensePageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ import { Link as RouterLink } from "react-router-dom";
66
import { ErrorAlert } from "components/Alert/ErrorAlert";
77
import { FileUpload } from "components/FileUpload/FileUpload";
88
import { displayError } from "components/GlobalSnackbar/utils";
9-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
109
import { Stack } from "components/Stack/Stack";
1110
import { Fieldset } from "../Fieldset";
11+
import { Header } from "../Header";
1212
import { DividerWithText } from "./DividerWithText";
1313

1414
type AddNewLicenseProps = {
@@ -50,7 +50,7 @@ export const AddNewLicensePageView: FC<AddNewLicenseProps> = ({
5050
direction="row"
5151
justifyContent="space-between"
5252
>
53-
<SettingsHeader
53+
<Header
5454
title="Add a license"
5555
description="Get access to high availability, RBAC, quotas, and more."
5656
/>

site/src/pages/DeploySettingsPage/LicensesSettingsPage/LicensesSettingsPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ import type { FC } from "react";
1010
import Confetti from "react-confetti";
1111
import { Link } from "react-router-dom";
1212
import type { GetLicensesResponse } from "api/api";
13-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
1413
import { Stack } from "components/Stack/Stack";
1514
import { useWindowSize } from "hooks/useWindowSize";
15+
import { Header } from "../Header";
1616
import { LicenseCard } from "./LicenseCard";
1717

1818
type Props = {
@@ -55,7 +55,7 @@ const LicensesSettingsPageView: FC<Props> = ({
5555
direction="row"
5656
justifyContent="space-between"
5757
>
58-
<SettingsHeader
58+
<Header
5959
title="Licenses"
6060
description="Manage licenses to unlock Enterprise features."
6161
/>

site/src/pages/DeploySettingsPage/NetworkSettingsPage/NetworkSettingsPageView.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import type { FC } from "react";
22
import type { SerpentOption } from "api/typesGenerated";
33
import { Badges, EnabledBadge, DisabledBadge } from "components/Badges/Badges";
4-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
54
import { Stack } from "components/Stack/Stack";
65
import {
76
deploymentGroupHasParent,
87
useDeploymentOptions,
98
} from "utils/deployOptions";
109
import { docs } from "utils/docs";
10+
import { Header } from "../Header";
1111
import OptionsTable from "../OptionsTable";
1212

1313
export type NetworkSettingsPageViewProps = {
@@ -19,7 +19,7 @@ export const NetworkSettingsPageView: FC<NetworkSettingsPageViewProps> = ({
1919
}) => (
2020
<Stack direction="column" spacing={6}>
2121
<div>
22-
<SettingsHeader
22+
<Header
2323
title="Network"
2424
description="Configure your deployment connectivity."
2525
docsHref={docs("/networking")}
@@ -32,7 +32,7 @@ export const NetworkSettingsPageView: FC<NetworkSettingsPageViewProps> = ({
3232
</div>
3333

3434
<div>
35-
<SettingsHeader
35+
<Header
3636
title="Port Forwarding"
3737
secondary
3838
description="Port forwarding lets developers securely access processes on their Coder workspace from a local machine."

site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/CreateOAuth2AppPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import type { FC } from "react";
44
import { Link } from "react-router-dom";
55
import type * as TypesGen from "api/typesGenerated";
66
import { ErrorAlert } from "components/Alert/ErrorAlert";
7-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
87
import { Stack } from "components/Stack/Stack";
8+
import { Header } from "../Header";
99
import { OAuth2AppForm } from "./OAuth2AppForm";
1010

1111
type CreateOAuth2AppProps = {
@@ -26,7 +26,7 @@ export const CreateOAuth2AppPageView: FC<CreateOAuth2AppProps> = ({
2626
direction="row"
2727
justifyContent="space-between"
2828
>
29-
<SettingsHeader
29+
<Header
3030
title="Add an OAuth2 application"
3131
description="Configure an application to use Coder as an OAuth2 provider."
3232
/>

site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/EditOAuth2AppPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ import { CopyableValue } from "components/CopyableValue/CopyableValue";
2020
import { ConfirmDialog } from "components/Dialogs/ConfirmDialog/ConfirmDialog";
2121
import { DeleteDialog } from "components/Dialogs/DeleteDialog/DeleteDialog";
2222
import { Loader } from "components/Loader/Loader";
23-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
2423
import { Stack } from "components/Stack/Stack";
2524
import { TableLoader } from "components/TableLoader/TableLoader";
2625
import { createDayString } from "utils/createDayString";
26+
import { Header } from "../Header";
2727
import { OAuth2AppForm } from "./OAuth2AppForm";
2828

2929
export type MutatingResource = {
@@ -75,7 +75,7 @@ export const EditOAuth2AppPageView: FC<EditOAuth2AppProps> = ({
7575
direction="row"
7676
justifyContent="space-between"
7777
>
78-
<SettingsHeader
78+
<Header
7979
title="Edit OAuth2 application"
8080
description="Configure an application to use Coder as an OAuth2 provider."
8181
/>

site/src/pages/DeploySettingsPage/OAuth2AppsSettingsPage/OAuth2AppsSettingsPageView.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ import type * as TypesGen from "api/typesGenerated";
1414
import { ErrorAlert } from "components/Alert/ErrorAlert";
1515
import { Avatar } from "components/Avatar/Avatar";
1616
import { AvatarData } from "components/AvatarData/AvatarData";
17-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
1817
import { Stack } from "components/Stack/Stack";
1918
import { TableLoader } from "components/TableLoader/TableLoader";
2019
import { useClickableTableRow } from "hooks/useClickableTableRow";
20+
import { Header } from "../Header";
2121

2222
type OAuth2AppsSettingsProps = {
2323
apps?: TypesGen.OAuth2ProviderApp[];
@@ -38,7 +38,7 @@ const OAuth2AppsSettingsPageView: FC<OAuth2AppsSettingsProps> = ({
3838
justifyContent="space-between"
3939
>
4040
<div>
41-
<SettingsHeader
41+
<Header
4242
title="OAuth2 Applications"
4343
description="Configure applications to use Coder as an OAuth2 provider."
4444
/>

site/src/pages/DeploySettingsPage/ObservabilitySettingsPage/ObservabilitySettingsPageView.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import {
66
EnabledBadge,
77
EnterpriseBadge,
88
} from "components/Badges/Badges";
9-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
109
import { Stack } from "components/Stack/Stack";
1110
import { deploymentGroupHasParent } from "utils/deployOptions";
1211
import { docs } from "utils/docs";
12+
import { Header } from "../Header";
1313
import OptionsTable from "../OptionsTable";
1414

1515
export type ObservabilitySettingsPageViewProps = {
@@ -24,8 +24,8 @@ export const ObservabilitySettingsPageView: FC<
2424
<>
2525
<Stack direction="column" spacing={6}>
2626
<div>
27-
<SettingsHeader title="Observability" />
28-
<SettingsHeader
27+
<Header title="Observability" />
28+
<Header
2929
title="Audit Logging"
3030
secondary
3131
description="Allow auditors to monitor user operations in your deployment."
@@ -39,7 +39,7 @@ export const ObservabilitySettingsPageView: FC<
3939
</div>
4040

4141
<div>
42-
<SettingsHeader
42+
<Header
4343
title="Monitoring"
4444
secondary
4545
description="Monitoring your Coder application with logs and metrics."

site/src/pages/DeploySettingsPage/SecuritySettingsPage/SecuritySettingsPageView.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,13 @@ import {
66
EnabledBadge,
77
EnterpriseBadge,
88
} from "components/Badges/Badges";
9-
import { SettingsHeader } from "components/SettingsHeader/SettingsHeader";
109
import { Stack } from "components/Stack/Stack";
1110
import {
1211
deploymentGroupHasParent,
1312
useDeploymentOptions,
1413
} from "utils/deployOptions";
1514
import { docs } from "utils/docs";
15+
import { Header } from "../Header";
1616
import OptionsTable from "../OptionsTable";
1717

1818
export type SecuritySettingsPageViewProps = {
@@ -31,7 +31,7 @@ export const SecuritySettingsPageView: FC<SecuritySettingsPageViewProps> = ({
3131
return (
3232
<Stack direction="column" spacing={6}>
3333
<div>
34-
<SettingsHeader
34+
<Header
3535
title="Security"
3636
description="Ensure your Coder deployment is secure."
3737
/>
@@ -47,7 +47,7 @@ export const SecuritySettingsPageView: FC<SecuritySettingsPageViewProps> = ({
4747
</div>
4848

4949
<div>
50-
<SettingsHeader
50+
<Header
5151
title="Browser Only Connections"
5252
secondary
5353
description="Block all workspace access via SSH, port forward, and other non-browser connections."
@@ -62,7 +62,7 @@ export const SecuritySettingsPageView: FC<SecuritySettingsPageViewProps> = ({
6262

6363
{tlsOptions.length > 0 && (
6464
<div>
65-
<SettingsHeader
65+
<Header
6666
title="TLS"
6767
secondary
6868
description="Ensure TLS is properly configured for your Coder deployment."

0 commit comments

Comments
 (0)