From e3ce9b4f72227f6e65c1d87d8be6280663821697 Mon Sep 17 00:00:00 2001 From: kiner-tang <1127031143@qq.com> Date: Wed, 17 Apr 2024 12:20:31 +0800 Subject: [PATCH] refactor: improve last updated styles for mobile devices (#2073) --- src/client/theme-default/slots/ContentFooter/index.less | 5 +++++ src/client/theme-default/slots/ContentFooter/index.tsx | 8 +++++--- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/client/theme-default/slots/ContentFooter/index.less b/src/client/theme-default/slots/ContentFooter/index.less index 036b78af10..a3a5e2cded 100644 --- a/src/client/theme-default/slots/ContentFooter/index.less +++ b/src/client/theme-default/slots/ContentFooter/index.less @@ -33,6 +33,11 @@ dd { margin: 0; + @media @mobile { + .dumi-default-mobile-hidden { + display: none; + } + } svg { margin-inline-end: 4px; diff --git a/src/client/theme-default/slots/ContentFooter/index.tsx b/src/client/theme-default/slots/ContentFooter/index.tsx index 15d2918fe9..0521860f45 100644 --- a/src/client/theme-default/slots/ContentFooter/index.tsx +++ b/src/client/theme-default/slots/ContentFooter/index.tsx @@ -20,7 +20,7 @@ const ContentFooter: FC = () => { const { frontmatter } = useRouteMeta(); const intl = useIntl(); const [prev, setPrev] = useState< - typeof sidebar[0]['children'][0] | undefined + (typeof sidebar)[0]['children'][0] | undefined >(undefined); const [next, setNext] = useState(undefined); const [isoLastUpdated, setIsoLastUpdated] = useState(''); @@ -31,7 +31,7 @@ const ContentFooter: FC = () => { // calculate the previous and next page useLayoutEffect(() => { if (sidebar) { - const items = sidebar.reduce( + const items = sidebar.reduce<(typeof sidebar)[0]['children']>( (ret, group) => ret.concat(group.children), [], ); @@ -61,7 +61,9 @@ const ContentFooter: FC = () => { {showLastUpdated && (
- + + +
)}