Skip to content

Commit

Permalink
remove-bottom-action
Browse files Browse the repository at this point in the history
  • Loading branch information
miroshar-success committed Apr 7, 2024
1 parent a51a673 commit a4d02a2
Showing 1 changed file with 3 additions and 67 deletions.
70 changes: 3 additions & 67 deletions src/layout/GlobalLayout/Desktop/SideBar/BottomActions.tsx
Original file line number Diff line number Diff line change
@@ -1,23 +1,10 @@
import { ActionIcon, DiscordIcon, Icon } from '@lobehub/ui';
import { ActionIcon, Icon } from '@lobehub/ui';
import { Badge, ConfigProvider, Dropdown, MenuProps } from 'antd';
import {
Book,
Feather,
FileClock,
Github,
HardDriveDownload,
HardDriveUpload,
Heart,
Settings,
Settings2,
} from 'lucide-react';
import Link from 'next/link';
import { useRouter } from 'next/navigation';
import { HardDriveDownload, HardDriveUpload, Settings2 } from 'lucide-react';
import { memo } from 'react';
import { useTranslation } from 'react-i18next';
import { Flexbox } from 'react-layout-kit';

import { ABOUT, CHANGELOG, DISCORD, DOCUMENTS, FEEDBACK, GITHUB } from '@/const/url';
import DataImporter from '@/features/DataImporter';
import { configService } from '@/services/config';
import { GlobalStore, useGlobalStore } from '@/store/global';
Expand All @@ -28,7 +15,6 @@ export interface BottomActionProps {
}

const BottomActions = memo<BottomActionProps>(({ tab }) => {
const router = useRouter();
const { t } = useTranslation('common');

const [hasNewVersion, useCheckLatestVersion] = useGlobalStore((s) => [
Expand Down Expand Up @@ -74,59 +60,10 @@ const BottomActions = memo<BottomActionProps>(({ tab }) => {
key: 'export',
label: t('export'),
},
{
type: 'divider',
},
{
icon: <Icon icon={Feather} />,
key: 'feedback',
label: t('feedback'),
onClick: () => window.open(FEEDBACK, '__blank'),
},
{
icon: <Icon icon={FileClock} />,
key: 'changelog',
label: t('changelog'),
onClick: () => window.open(CHANGELOG, '__blank'),
},
{
icon: <Icon icon={DiscordIcon} />,
key: 'wiki',
label: 'Discord',
onClick: () => window.open(DISCORD, '__blank'),
},
{
icon: <Icon icon={Heart} />,
key: 'about',
label: t('about'),
onClick: () => window.open(ABOUT, '__blank'),
},
{
type: 'divider',
},
{
icon: <Icon icon={Settings} />,
key: 'setting',
label: (
<Flexbox align={'center'} distribution={'space-between'} gap={8} horizontal>
{t('setting')} {hasNewVersion && <Badge count={t('upgradeVersion.hasNew')} />}
</Flexbox>
),
onClick: () => {
router.push('/settings/common');
},
},
];

return (
<>
<Link aria-label={'GitHub'} href={GITHUB} target={'_blank'}>
<ActionIcon icon={Github} placement={'right'} title={'GitHub'} />
</Link>
<Link aria-label={t('document')} href={DOCUMENTS} target={'_blank'}>
<ActionIcon icon={Book} placement={'right'} title={t('document')} />
</Link>
<Dropdown arrow={false} menu={{ items }} trigger={['click']}>
<Dropdown arrow={false} menu={{ items }} trigger={['click']}>
{hasNewVersion ? (
<Flexbox>
<ConfigProvider theme={{ components: { Badge: { dotSize: 8 } } }}>
Expand All @@ -139,7 +76,6 @@ const BottomActions = memo<BottomActionProps>(({ tab }) => {
<ActionIcon active={tab === SidebarTabKey.Setting} icon={Settings2} />
)}
</Dropdown>
</>
);
});

Expand Down

0 comments on commit a4d02a2

Please sign in to comment.