From 293510095249492f5d2da2817af33a13c2d71e5f Mon Sep 17 00:00:00 2001 From: McKayla Washburn Date: Thu, 9 May 2024 22:19:37 +0000 Subject: [PATCH] feat: popover paywall in appearance settings --- .../Paywall/PopoverPaywall.stories.tsx | 20 +++ .../src/components/Paywall/PopoverPaywall.tsx | 125 ++++++++++++++++++ .../AppearanceSettingsPageView.tsx | 21 ++- 3 files changed, 165 insertions(+), 1 deletion(-) create mode 100644 site/src/components/Paywall/PopoverPaywall.stories.tsx create mode 100644 site/src/components/Paywall/PopoverPaywall.tsx diff --git a/site/src/components/Paywall/PopoverPaywall.stories.tsx b/site/src/components/Paywall/PopoverPaywall.stories.tsx new file mode 100644 index 0000000000000..3f85328c1fb98 --- /dev/null +++ b/site/src/components/Paywall/PopoverPaywall.stories.tsx @@ -0,0 +1,20 @@ +import type { Meta, StoryObj } from "@storybook/react"; +import { PopoverPaywall } from "./PopoverPaywall"; + +const meta: Meta = { + title: "components/Paywall/PopoverPaywall", + component: PopoverPaywall, +}; + +export default meta; +type Story = StoryObj; + +const Example: Story = { + args: { + message: "Black Lotus", + description: + "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.", + }, +}; + +export { Example as PopoverPaywall }; diff --git a/site/src/components/Paywall/PopoverPaywall.tsx b/site/src/components/Paywall/PopoverPaywall.tsx new file mode 100644 index 0000000000000..459d7c58fb22b --- /dev/null +++ b/site/src/components/Paywall/PopoverPaywall.tsx @@ -0,0 +1,125 @@ +import type { Interpolation, Theme } from "@emotion/react"; +import TaskAltIcon from "@mui/icons-material/TaskAlt"; +import Button from "@mui/material/Button"; +import Link from "@mui/material/Link"; +import type { FC, ReactNode } from "react"; +import { EnterpriseBadge } from "components/Badges/Badges"; +import { Stack } from "components/Stack/Stack"; +import { docs } from "utils/docs"; + +export interface PopoverPaywallProps { + message: string; + description?: ReactNode; + documentationLink?: string; +} + +export const PopoverPaywall: FC = ({ + message, + description, + documentationLink, +}) => { + return ( +
+
+ +
{message}
+ +
+ + {description &&

{description}

} + + Read the documentation + +
+
+ +
    +
  • + Template access control +
  • +
  • + User groups +
  • +
  • + 24 hour support +
  • +
  • + Audit logs +
  • +
+ +
+
+ ); +}; + +const FeatureIcon: FC = () => { + return ; +}; + +const styles = { + root: (theme) => ({ + display: "flex", + flexDirection: "row", + alignItems: "center", + maxWidth: 600, + padding: "24px 36px", + backgroundImage: `linear-gradient(160deg, transparent, ${theme.roles.active.background})`, + border: `1px solid ${theme.roles.active.fill.outline}`, + borderRadius: 8, + gap: 18, + }), + title: { + fontWeight: 600, + fontFamily: "inherit", + fontSize: 18, + margin: 0, + }, + description: (theme) => ({ + marginTop: 8, + fontFamily: "inherit", + maxWidth: 420, + lineHeight: "160%", + color: theme.palette.text.secondary, + fontSize: 14, + }), + separator: (theme) => ({ + width: 1, + height: 180, + backgroundColor: theme.palette.divider, + marginLeft: 8, + }), + featureList: { + listStyle: "none", + margin: 0, + marginRight: 8, + padding: "0 12px", + fontSize: 13, + fontWeight: 500, + }, + featureIcon: (theme) => ({ + color: theme.roles.active.fill.outline, + fontSize: "1.5em", + }), + feature: { + display: "flex", + alignItems: "center", + padding: 3, + gap: 8, + lineHeight: 1.2, + }, +} satisfies Record>; diff --git a/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx b/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx index b62a20e923c89..fb8ec4a891de8 100644 --- a/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx +++ b/site/src/pages/DeploySettingsPage/AppearanceSettingsPage/AppearanceSettingsPageView.tsx @@ -10,6 +10,12 @@ import { EnterpriseBadge, EntitledBadge, } from "components/Badges/Badges"; +import { PopoverPaywall } from "components/Paywall/PopoverPaywall"; +import { + Popover, + PopoverContent, + PopoverTrigger, +} from "components/Popover/Popover"; import { getFormHelpers } from "utils/formUtils"; import { Fieldset } from "../Fieldset"; import { Header } from "../Header"; @@ -55,7 +61,20 @@ export const AppearanceSettingsPageView: FC< {isEntitled ? : } - + + + + + + + + + +