Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

refactor: Add enterprise badge to paywalls#4477

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
BrunoQuaresma merged 1 commit intomainfrombq/add-enterprise-badge
Oct 11, 2022
Merged
Changes fromall 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
81 changes: 47 additions & 34 deletionssite/src/components/Paywall/Paywall.tsx
View file
Open in desktop
Original file line numberDiff line numberDiff 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,
},
}))

[8]ページ先頭

©2009-2025 Movatter.jp