Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
refactor: Add enterprise badge to paywalls
  • Loading branch information
BrunoQuaresma committed Oct 11, 2022
commit 61a5c70312b8ced9e34c148b9179dea472543abb
81 changes: 47 additions & 34 deletions site/src/components/Paywall/Paywall.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import Box from "@material-ui/core/Box"
import Chip from "@material-ui/core/Chip"
import { makeStyles } from "@material-ui/core/styles"
import Typography from "@material-ui/core/Typography"
import { Stack } from "components/Stack/Stack"
import { FC, ReactNode } from "react"
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"

export interface PaywallProps {
message: string
Expand All @@ -17,9 +18,18 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
return (
<Box className={styles.root}>
<div className={styles.header}>
<Typography variant="h5" className={styles.title}>
{message}
</Typography>
<Stack direction="row" alignItems="center" justifyContent="center">
<Typography variant="h5" className={styles.title}>
{message}
</Typography>
<Chip
className={styles.enterpriseChip}
label="Enterprise"
size="small"
color="primary"
/>
</Stack>

{description && (
<Typography
variant="body2"
Expand All @@ -35,33 +45,36 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
)
}

const useStyles = makeStyles(
(theme) => ({
root: {
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
textAlign: "center",
minHeight: 300,
padding: theme.spacing(3),
fontFamily: MONOSPACE_FONT_FAMILY,
backgroundColor: theme.palette.background.paper,
border: `1px solid ${theme.palette.divider}`,
borderRadius: theme.shape.borderRadius,
},
header: {
marginBottom: theme.spacing(3),
},
title: {
fontWeight: 600,
fontFamily: "inherit",
},
description: {
marginTop: theme.spacing(1),
fontFamily: "inherit",
maxWidth: 420,
},
}),
{ name: "Paywall" },
)
const useStyles = makeStyles((theme) => ({
root: {
display: "flex",
flexDirection: "column",
justifyContent: "center",
alignItems: "center",
textAlign: "center",
minHeight: 300,
padding: theme.spacing(3),
backgroundColor: theme.palette.background.paper,
border: `1px solid ${theme.palette.divider}`,
borderRadius: theme.shape.borderRadius,
},
header: {
marginBottom: theme.spacing(3),
},
title: {
fontWeight: 600,
fontFamily: "inherit",
},
description: {
marginTop: theme.spacing(1),
fontFamily: "inherit",
maxWidth: 420,
lineHeight: "160%",
},
enterpriseChip: {
background: theme.palette.success.dark,
color: theme.palette.success.contrastText,
border: `1px solid ${theme.palette.success.light}`,
fontSize: 13,
},
}))