Skip to content

Commit 4eade9d

Browse files
authored
fix(docs/index): overflow issue in install command (#1095)
1 parent 7aa7799 commit 4eade9d

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

apps/material-react-table-docs/components/mdx/InstallCommand.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ export const InstallCommand = ({
3131
className="language-bash"
3232
margin="0"
3333
style={{ overflowX: 'hidden' }}
34+
paperSxProps={{
35+
'& .token-line': {
36+
overflowX: 'auto',
37+
},
38+
}}
3439
>
3540
{tab === 'npm'
3641
? `npm i ${packagesString}`

apps/material-react-table-docs/components/mdx/SampleCodeSnippet.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import {
66
styled,
77
alpha,
88
Paper,
9+
type SxProps,
10+
type Theme,
911
} from '@mui/material';
1012
import { Highlight, themes } from 'prism-react-renderer';
1113
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
@@ -23,9 +25,10 @@ interface Props {
2325
enableCopyButton?: boolean;
2426
style?: CSSProperties;
2527
margin?: string;
28+
paperSxProps?: SxProps<Theme>;
2629
}
2730

28-
export const SampleCodeSnippet = (props: Props) => {
31+
export const SampleCodeSnippet = ({ paperSxProps, ...props }: Props) => {
2932
const theme = useTheme();
3033
const [isCopied, setIsCopied] = useState(false);
3134

@@ -66,6 +69,7 @@ export const SampleCodeSnippet = (props: Props) => {
6669
boxShadow: props.enableCopyButton === false ? 'none' : undefined,
6770
backgroundImage: 'none',
6871
backgroundColor: 'transparent',
72+
...paperSxProps,
6973
}}
7074
>
7175
<Highlight

0 commit comments

Comments
 (0)