mirror of
https://gitee.com/ant-design/ant-design.git
synced 2024-11-30 11:08:45 +08:00
docs: hide banner (#46730)
* docs: hide banner * chore: code clean * Update GlobalLayout.tsx Signed-off-by: lijianan <574980606@qq.com> --------- Signed-off-by: lijianan <574980606@qq.com> Co-authored-by: afc163 <afc163@gmail.com> Co-authored-by: lijianan <574980606@qq.com>
This commit is contained in:
parent
17a634b6a2
commit
4920955741
@ -1,5 +1,4 @@
|
||||
import React, { useCallback, useEffect, useMemo, Suspense } from 'react';
|
||||
import dayjs from 'dayjs';
|
||||
import {
|
||||
createCache,
|
||||
extractStyle,
|
||||
@ -102,15 +101,15 @@ const GlobalLayout: React.FC = () => {
|
||||
useEffect(() => {
|
||||
const _theme = searchParams.getAll('theme') as ThemeName[];
|
||||
const _direction = searchParams.get('direction') as DirectionType;
|
||||
const storedBannerVisibleLastTime =
|
||||
localStorage && localStorage.getItem(ANT_DESIGN_NOT_SHOW_BANNER);
|
||||
const storedBannerVisible =
|
||||
storedBannerVisibleLastTime && dayjs().diff(dayjs(storedBannerVisibleLastTime), 'day') >= 1;
|
||||
// const storedBannerVisibleLastTime =
|
||||
// localStorage && localStorage.getItem(ANT_DESIGN_NOT_SHOW_BANNER);
|
||||
// const storedBannerVisible =
|
||||
// storedBannerVisibleLastTime && dayjs().diff(dayjs(storedBannerVisibleLastTime), 'day') >= 1;
|
||||
|
||||
setSiteState({
|
||||
theme: _theme,
|
||||
direction: _direction === 'rtl' ? 'rtl' : 'ltr',
|
||||
bannerVisible: storedBannerVisibleLastTime ? !!storedBannerVisible : true,
|
||||
// bannerVisible: storedBannerVisibleLastTime ? !!storedBannerVisible : true,
|
||||
});
|
||||
// Handle isMobile
|
||||
updateMobileMode();
|
||||
|
@ -12,7 +12,7 @@ export interface SiteContextProps {
|
||||
|
||||
const SiteContext = React.createContext<SiteContextProps>({
|
||||
isMobile: false,
|
||||
bannerVisible: true,
|
||||
bannerVisible: false,
|
||||
direction: 'ltr',
|
||||
theme: ['light'],
|
||||
updateSiteConfig: () => {},
|
||||
|
Loading…
Reference in New Issue
Block a user