Skip to content

Commit

Permalink
fix(docs/index): overflow issue in install command (#1095)
Browse files Browse the repository at this point in the history
  • Loading branch information
tometo-dev authored Apr 18, 2024
1 parent 7aa7799 commit 4eade9d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ export const InstallCommand = ({
className="language-bash"
margin="0"
style={{ overflowX: 'hidden' }}
paperSxProps={{
'& .token-line': {
overflowX: 'auto',
},
}}
>
{tab === 'npm'
? `npm i ${packagesString}`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ import {
styled,
alpha,
Paper,
type SxProps,
type Theme,
} from '@mui/material';
import { Highlight, themes } from 'prism-react-renderer';
import ContentCopyIcon from '@mui/icons-material/ContentCopy';
Expand All @@ -23,9 +25,10 @@ interface Props {
enableCopyButton?: boolean;
style?: CSSProperties;
margin?: string;
paperSxProps?: SxProps<Theme>;
}

export const SampleCodeSnippet = (props: Props) => {
export const SampleCodeSnippet = ({ paperSxProps, ...props }: Props) => {
const theme = useTheme();
const [isCopied, setIsCopied] = useState(false);

Expand Down Expand Up @@ -66,6 +69,7 @@ export const SampleCodeSnippet = (props: Props) => {
boxShadow: props.enableCopyButton === false ? 'none' : undefined,
backgroundImage: 'none',
backgroundColor: 'transparent',
...paperSxProps,
}}
>
<Highlight
Expand Down

0 comments on commit 4eade9d

Please sign in to comment.