Thanks to visit codestin.com
Credit goes to github.com

Skip to content

chore: use emotion for styling (pt. 5) #10261

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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 37 commits into from
Oct 16, 2023
Merged
Changes from 1 commit
Commits
Show all changes
37 commits
Select commit Hold shift + click to select a range
8ef2a58
emotion: `RuntimeErrorState`
aslilac Oct 13, 2023
c455b38
emotion: `FileUpload`
aslilac Oct 13, 2023
4e033c6
🧹
aslilac Oct 13, 2023
8d7e9a8
emotion: `FullPageForm`
aslilac Oct 13, 2023
eeb1b93
emotion: `EnterpriseSnackbar`
aslilac Oct 13, 2023
04adebe
emotion: `GlobalSnackbar`
aslilac Oct 13, 2023
2b49f62
emotion: `FullWidthPageHeader`
aslilac Oct 13, 2023
57b1f68
emotion: `PageButton`
aslilac Oct 13, 2023
715282c
emotion: `PaginationWidgetBase`
aslilac Oct 13, 2023
8927e23
emotion: `Paywall`
aslilac Oct 13, 2023
1857b71
emotion: `AgentLatency`
aslilac Oct 13, 2023
5bacdda
emotion: `AgentOutdatedTooltip`
aslilac Oct 13, 2023
9924a32
emotion: `PortForwardButton`
aslilac Oct 13, 2023
d49898c
emotion: `Section`
aslilac Oct 13, 2023
f4373dd
emotion: `AppLink`
aslilac Oct 13, 2023
351e310
🧹
aslilac Oct 13, 2023
196c7a8
emotion: `SensitiveValue`
aslilac Oct 13, 2023
3d14e1b
emotion: `BuildRow`
aslilac Oct 13, 2023
58daeaf
emotion: `ResetPasswordDialog`
aslilac Oct 13, 2023
8a5e35f
emotion: `UsersTableBody`
aslilac Oct 13, 2023
c8a94a5
emotion: `Workspace`
aslilac Oct 13, 2023
7058b7f
emotion: `UpdateBuildParametersDialog`
aslilac Oct 13, 2023
0972a1c
emotion: `SignInLayout`
aslilac Oct 13, 2023
2481674
emotion: `SSHButton`
aslilac Oct 13, 2023
f09e627
emotion: `TableLoader`
aslilac Oct 13, 2023
7135de3
emotion: `Welcome`
aslilac Oct 13, 2023
193c364
emotion: `TimelineDateRow`
aslilac Oct 13, 2023
007e048
emotion: `SSHKeysPageView`
aslilac Oct 13, 2023
10f041c
emotion: `WorkspaceSettingsLayout`
aslilac Oct 13, 2023
ec8cc6e
emotion: `TemplateLayout`
aslilac Oct 13, 2023
da1a641
emotion: `EmptyTemplates`
aslilac Oct 13, 2023
69fd068
emotion: `TemplateVariablesPageView`
aslilac Oct 13, 2023
fcc868b
Merge branch 'main' into emotional-damage-5
aslilac Oct 16, 2023
4b92f61
Revert "emotion: `AgentOutdatedTooltip`"
aslilac Oct 16, 2023
c2abccb
Revert "emotion: `PortForwardButton`"
aslilac Oct 16, 2023
9f73611
Revert "emotion: `Section`"
aslilac Oct 16, 2023
e3986d2
Revert "emotion: `AppLink`"
aslilac Oct 16, 2023
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
Prev Previous commit
Next Next commit
emotion: Paywall
  • Loading branch information
aslilac committed Oct 13, 2023
commit 8927e2355ba4a36a6445da84ceaf07fb19fee5dc
35 changes: 17 additions & 18 deletions site/src/components/Paywall/Paywall.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import Box from "@mui/material/Box";
import Chip from "@mui/material/Chip";
import { makeStyles } from "@mui/styles";
import Typography from "@mui/material/Typography";
import { type FC, type ReactNode } from "react";
import { type Interpolation, type Theme } from "@emotion/react";
import { Stack } from "components/Stack/Stack";
import { FC, ReactNode } from "react";

export interface PaywallProps {
message: string;
Expand All @@ -13,17 +13,16 @@ export interface PaywallProps {

export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
const { message, description, cta } = props;
const styles = useStyles();

return (
<Box className={styles.root}>
<div className={styles.header}>
<Box css={styles.root}>
<div css={styles.header}>
<Stack direction="row" alignItems="center" justifyContent="center">
<Typography variant="h5" className={styles.title}>
<Typography variant="h5" css={styles.title}>
{message}
</Typography>
<Chip
className={styles.enterpriseChip}
css={styles.enterpriseChip}
label="Enterprise"
size="small"
color="primary"
Expand All @@ -34,7 +33,7 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
<Typography
variant="body2"
color="textSecondary"
className={styles.description}
css={styles.description}
>
{description}
</Typography>
Expand All @@ -45,8 +44,8 @@ export const Paywall: FC<React.PropsWithChildren<PaywallProps>> = (props) => {
);
};

const useStyles = makeStyles((theme) => ({
root: {
const styles = {
root: (theme) => ({
display: "flex",
flexDirection: "column",
justifyContent: "center",
Expand All @@ -57,24 +56,24 @@ const useStyles = makeStyles((theme) => ({
backgroundColor: theme.palette.background.paper,
border: `1px solid ${theme.palette.divider}`,
borderRadius: theme.shape.borderRadius,
},
header: {
}),
header: (theme) => ({
marginBottom: theme.spacing(3),
},
}),
title: {
fontWeight: 600,
fontFamily: "inherit",
},
description: {
description: (theme) => ({
marginTop: theme.spacing(1),
fontFamily: "inherit",
maxWidth: 420,
lineHeight: "160%",
},
enterpriseChip: {
}),
enterpriseChip: (theme) => ({
background: theme.palette.success.dark,
color: theme.palette.success.contrastText,
border: `1px solid ${theme.palette.success.light}`,
fontSize: 13,
},
}));
}),
} satisfies Record<string, Interpolation<Theme>>;