docs: tweak changelog drawer width in small screen (#46791)

This commit is contained in:
afc163 2024-01-04 15:42:11 +08:00 committed by GitHub
parent aae661b176
commit f1954384dc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,7 +1,7 @@
/* eslint-disable global-require */
import React, { useMemo } from 'react';
import { HistoryOutlined } from '@ant-design/icons';
import { Button, Drawer, Timeline, Typography } from 'antd';
import { Button, Drawer, Timeline, Typography, Grid } from 'antd';
import { createStyles } from 'antd-style';
import useFetch from '../../../hooks/useFetch';
@ -158,6 +158,9 @@ export default function ComponentChangelog(props: ComponentChangelogProps) {
});
}, [list]);
const screens = Grid.useBreakpoint();
const width = screens.md ? '48vw' : '90vw';
if (!list || !list.length) {
return null;
}
@ -181,7 +184,7 @@ export default function ComponentChangelog(props: ComponentChangelogProps) {
</Link>
}
open={show}
width="40vw"
width={width}
onClose={() => {
setShow(false);
}}