import { MyIcon } from '@/global';
import { HomeOutlined } from '@ant-design/icons';
import { SelectLang as UmiSelectLang, useModel } from '@umijs/max';
import { Button, Dropdown, MenuProps, Space, Tour } from 'antd';
import { useEffect, useRef, useState } from 'react';
import DraggableButton from '../DraggableButton';
import MenuChange from '../MenuChange';
export type SiderTheme = 'light' | 'dark';
export const SelectLang = () => {
return (
);
};
export const Question = () => {
const { initialState, setInitialState } = useModel('@@initialState');
const ref = useRef(null);
const [open, setOpen] = useState(false);
useEffect(() => {
let isOne = localStorage.getItem('isOne');
if (!isOne && initialState?.menuType === 'miniApp' && !open) {
console.log('111111');
setOpen(true);
}
}, [initialState?.menuType, open]);
const items: MenuProps['items'] = [
// { key: "1", label: 跟随系统 },
{
key: '2',
label: (
亮色模式
),
},
{
key: '3',
label: (
暗色模式
),
},
];
const onClick: MenuProps['onClick'] = ({ key }: any) => {
localStorage.setItem('navTheme', key);
setInitialState({ ...initialState, navTheme: key } as any);
};
return (
{initialState?.navTheme === '2' ? (
) : (
)}
{initialState?.menuType === 'miniApp' && (
)}
{
setOpen(false);
localStorage.setItem('isOne', '1');
}}
steps={[
{
title: '返回主页',
description: (
<>
{' '}
{' '}
可随意拖动位置,点击可从当前页面返回到分销商平台主页!
>
),
target: () => ref.current,
},
]}
/>
);
};