Skip to content

Commit 1a3f00e

Browse files
committed
Merge remote-tracking branch 'origin/feature/add-styled-divider'
2 parents 7ff0cc8 + 3a691dc commit 1a3f00e

File tree

2 files changed

+11
-0
lines changed

2 files changed

+11
-0
lines changed

packages/common/src/components/mdx.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import * as R from "remeda";
2121
import Hooks from "../hooks";
2222
import { ErrorFallback } from "./error_handler";
2323
import { rtrim } from "../utils/string";
24+
import { StyledDivider } from "./mdx_components/styled_divider";
2425

2526
const REGISTERED_KEYWORDS = [
2627
"import",
@@ -52,6 +53,7 @@ const CustomMDXComponents: MDXComponents = {
5253
h5: (props) => <h5 {...props} />,
5354
h6: (props) => <h6 {...props} />,
5455
strong: (props) => <strong {...props} />,
56+
hr: (props) => <StyledDivider {...props} />,
5557
em: (props) => <em {...props} />,
5658
ul: (props) => <ul {...props} />,
5759
ol: (props) => <ol {...props} />,
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { Divider, DividerProps, useTheme } from "@mui/material";
2+
import * as React from "react";
3+
4+
export const StyledDivider: React.FC<DividerProps> = (props) => {
5+
const { palette } = useTheme();
6+
const sx = { borderColor: palette.primary.dark, ...props.sx };
7+
const newProps = { ...props, sx };
8+
return <Divider {...newProps} />;
9+
};

0 commit comments

Comments
 (0)