Skip to content

Commit 934777d

Browse files
refactor: Add enterprise badge to paywalls (#4477)
1 parent 5411abb commit 934777d

File tree

1 file changed

+47
-34
lines changed

1 file changed

+47
-34
lines changed
Lines changed: 47 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
11
import Box from "@material-ui/core/Box"
2+
import Chip from "@material-ui/core/Chip"
23
import { makeStyles } from "@material-ui/core/styles"
34
import Typography from "@material-ui/core/Typography"
5+
import { Stack } from "components/Stack/Stack"
46
import { FC, ReactNode } from "react"
5-
import { MONOSPACE_FONT_FAMILY } from "../../theme/constants"
67

78
export interface PaywallProps {
89
message: string
@@ -17,9 +18,18 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
1718
return (
1819
<Box className={styles.root}>
1920
<div className={styles.header}>
20-
<Typography variant="h5" className={styles.title}>
21-
{message}
22-
</Typography>
21+
<Stack direction="row" alignItems="center" justifyContent="center">
22+
<Typography variant="h5" className={styles.title}>
23+
{message}
24+
</Typography>
25+
<Chip
26+
className={styles.enterpriseChip}
27+
label="Enterprise"
28+
size="small"
29+
color="primary"
30+
/>
31+
</Stack>
32+
2333
{description && (
2434
<Typography
2535
variant="body2"
@@ -35,33 +45,36 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
3545
)
3646
}
3747

38-
const useStyles = makeStyles(
39-
(theme) => ({
40-
root: {
41-
display: "flex",
42-
flexDirection: "column",
43-
justifyContent: "center",
44-
alignItems: "center",
45-
textAlign: "center",
46-
minHeight: 300,
47-
padding: theme.spacing(3),
48-
fontFamily: MONOSPACE_FONT_FAMILY,
49-
backgroundColor: theme.palette.background.paper,
50-
border: `1px solid ${theme.palette.divider}`,
51-
borderRadius: theme.shape.borderRadius,
52-
},
53-
header: {
54-
marginBottom: theme.spacing(3),
55-
},
56-
title: {
57-
fontWeight: 600,
58-
fontFamily: "inherit",
59-
},
60-
description: {
61-
marginTop: theme.spacing(1),
62-
fontFamily: "inherit",
63-
maxWidth: 420,
64-
},
65-
}),
66-
{ name: "Paywall" },
67-
)
48+
const useStyles = makeStyles((theme) => ({
49+
root: {
50+
display: "flex",
51+
flexDirection: "column",
52+
justifyContent: "center",
53+
alignItems: "center",
54+
textAlign: "center",
55+
minHeight: 300,
56+
padding: theme.spacing(3),
57+
backgroundColor: theme.palette.background.paper,
58+
border: `1px solid ${theme.palette.divider}`,
59+
borderRadius: theme.shape.borderRadius,
60+
},
61+
header: {
62+
marginBottom: theme.spacing(3),
63+
},
64+
title: {
65+
fontWeight: 600,
66+
fontFamily: "inherit",
67+
},
68+
description: {
69+
marginTop: theme.spacing(1),
70+
fontFamily: "inherit",
71+
maxWidth: 420,
72+
lineHeight: "160%",
73+
},
74+
enterpriseChip: {
75+
background: theme.palette.success.dark,
76+
color: theme.palette.success.contrastText,
77+
border: `1px solid ${theme.palette.success.light}`,
78+
fontSize: 13,
79+
},
80+
}))

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy