Skip to content

chore: use emotion for styling (pt. 8) #10447

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 23 commits into from
Nov 1, 2023
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
emotion: DividerWithText
  • Loading branch information
aslilac committed Oct 31, 2023
commit c04d181b6ef98780c523982918c6856c197ef9d7
Original file line number Diff line number Diff line change
@@ -1,32 +1,31 @@
import { makeStyles } from "@mui/styles";
import { FC, PropsWithChildren } from "react";
import { type Interpolation, type Theme } from "@emotion/react";
import { type FC, type PropsWithChildren } from "react";

export const DividerWithText: FC<PropsWithChildren> = ({ children }) => {
const classes = useStyles();
return (
<div className={classes.container}>
<div className={classes.border} />
<span className={classes.content}>{children}</span>
<div className={classes.border} />
<div css={styles.container}>
<div css={styles.border} />
<span css={styles.content}>{children}</span>
<div css={styles.border} />
</div>
);
};

const useStyles = makeStyles((theme) => ({
const styles = {
container: {
display: "flex",
alignItems: "center",
},
border: {
border: (theme) => ({
borderBottom: `2px solid ${theme.palette.divider}`,
width: "100%",
},
content: {
}),
content: (theme) => ({
paddingTop: theme.spacing(0.5),
paddingBottom: theme.spacing(0.5),
paddingRight: theme.spacing(2),
paddingLeft: theme.spacing(2),
fontSize: theme.typography.h5.fontSize,
color: theme.palette.text.secondary,
},
}));
}),
} satisfies Record<string, Interpolation<Theme>>;