perf: auto load icons (#688)

* perf: icon

* perf: icon

* doc

* perf: simple edit ui

* doc

* doc

* doc

* doc
This commit is contained in:
Archer
2024-01-03 23:51:12 +08:00
committed by GitHub
parent 2fc6e921e0
commit c2abbb579f
246 changed files with 2189 additions and 1380 deletions

View File

@@ -8,7 +8,7 @@ import { feConfigs } from '@/web/common/system/staticData';
import NextLink from 'next/link';
import Badge from '../Badge';
import Avatar from '../Avatar';
import MyIcon from '../Icon';
import MyIcon from '@fastgpt/web/components/common/Icon';
import { useTranslation } from 'next-i18next';
import { useSystemStore } from '@/web/common/system/useSystemStore';
import MyTooltip from '../MyTooltip';
@@ -29,8 +29,8 @@ const Navbar = ({ unread }: { unread: number }) => {
() => [
{
label: t('navbar.Chat'),
icon: 'chat',
activeIcon: 'chatFill',
icon: 'core/chat/chatLight',
activeIcon: 'chatcore/dataset/chatFillFill',
link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`,
activeLink: ['/chat']
},
@@ -50,26 +50,15 @@ const Navbar = ({ unread }: { unread: number }) => {
},
{
label: t('navbar.Datasets'),
icon: 'dbLight',
activeIcon: 'dbFill',
icon: 'core/dataset/datasetLight',
activeIcon: 'core/dataset/datasetFill',
link: `/dataset/list`,
activeLink: ['/dataset/list', '/dataset/detail']
},
...(feConfigs?.show_appStore
? [
{
label: t('navbar.Store'),
icon: 'appStoreLight',
activeIcon: 'appStoreFill',
link: '/appStore',
activeLink: ['/appStore']
}
]
: []),
{
label: t('navbar.Account'),
icon: 'meLight',
activeIcon: 'meFill',
icon: 'support/user/userLight',
activeIcon: 'support/user/userFill',
link: '/account',
activeLink: ['/account']
}
@@ -191,7 +180,7 @@ const Navbar = ({ unread }: { unread: number }) => {
mt={0}
color={'#9096a5'}
>
<MyIcon name={'git'} width={'22px'} height={'22px'} />
<MyIcon name={'common/gitLight'} width={'22px'} height={'22px'} />
</Link>
</MyTooltip>
)}

View File

@@ -4,7 +4,7 @@ import { Flex, Box } from '@chakra-ui/react';
import { useChatStore } from '@/web/core/chat/storeChat';
import { useTranslation } from 'next-i18next';
import Badge from '../Badge';
import MyIcon from '../Icon';
import MyIcon from '@fastgpt/web/components/common/Icon';
const NavbarPhone = ({ unread }: { unread: number }) => {
const router = useRouter();
@@ -14,7 +14,7 @@ const NavbarPhone = ({ unread }: { unread: number }) => {
() => [
{
label: t('navbar.Chat'),
icon: 'chat',
icon: 'core/chat/chatLight',
link: `/chat?appId=${lastChatAppId}&chatId=${lastChatId}`,
activeLink: ['/chat'],
unread: 0
@@ -28,14 +28,14 @@ const NavbarPhone = ({ unread }: { unread: number }) => {
},
{
label: t('navbar.Tools'),
icon: 'tabbarMore',
icon: 'phoneTabbar/tabbarMore',
link: '/tools',
activeLink: ['/tools'],
unread: 0
},
{
label: t('navbar.Account'),
icon: 'tabbarMe',
icon: 'phoneTabbar/tabbarMe',
link: '/account',
activeLink: ['/account'],
unread