mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-30 18:48:55 +00:00
4.8.5 perf app ui (#1845)
* list ui and layout * rename token key * app ui * ssr
This commit is contained in:
@@ -10,7 +10,6 @@ import { getUnreadCount } from '@/web/support/user/inform/api';
|
||||
import dynamic from 'next/dynamic';
|
||||
|
||||
import Auth from './auth';
|
||||
|
||||
const Navbar = dynamic(() => import('./navbar'));
|
||||
const NavbarPhone = dynamic(() => import('./navbarPhone'));
|
||||
const UpdateInviteModal = dynamic(() => import('@/components/support/user/team/UpdateInviteModal'));
|
||||
@@ -79,7 +78,7 @@ const Layout = ({ children }: { children: JSX.Element }) => {
|
||||
return (
|
||||
<>
|
||||
<Box h={'100%'} bg={'myGray.100'}>
|
||||
{isPc ? (
|
||||
{isPc === true && (
|
||||
<>
|
||||
{isHideNavbar ? (
|
||||
<Auth>{children}</Auth>
|
||||
@@ -94,22 +93,21 @@ const Layout = ({ children }: { children: JSX.Element }) => {
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
)}
|
||||
{isPc === false && (
|
||||
<>
|
||||
<Box h={'100%'} display={['block', 'none']}>
|
||||
{phoneUnShowLayoutRoute[router.pathname] || isChatPage ? (
|
||||
<Auth>{children}</Auth>
|
||||
) : (
|
||||
<Flex h={'100%'} flexDirection={'column'}>
|
||||
<Box flex={'1 0 0'} h={0}>
|
||||
<Auth>{children}</Auth>
|
||||
</Box>
|
||||
<Box h={'50px'} borderTop={'1px solid rgba(0,0,0,0.1)'}>
|
||||
<NavbarPhone unread={unread} />
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
</Box>
|
||||
{phoneUnShowLayoutRoute[router.pathname] || isChatPage ? (
|
||||
<Auth>{children}</Auth>
|
||||
) : (
|
||||
<Flex h={'100%'} flexDirection={'column'}>
|
||||
<Box flex={'1 0 0'} h={0}>
|
||||
<Auth>{children}</Auth>
|
||||
</Box>
|
||||
<Box h={'50px'} borderTop={'1px solid rgba(0,0,0,0.1)'}>
|
||||
<NavbarPhone unread={unread} />
|
||||
</Box>
|
||||
</Flex>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
</Box>
|
||||
|
@@ -88,7 +88,7 @@ const Navbar = ({ unread }: { unread: number }) => {
|
||||
{/* logo */}
|
||||
<Box
|
||||
flex={'0 0 auto'}
|
||||
mb={5}
|
||||
mb={3}
|
||||
border={'2px solid #fff'}
|
||||
borderRadius={'50%'}
|
||||
overflow={'hidden'}
|
||||
|
@@ -1,6 +1,6 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import { PermissionTypeEnum, PermissionTypeMap } from '@fastgpt/global/support/permission/constant';
|
||||
import { Box, Flex, FlexProps } from '@chakra-ui/react';
|
||||
import { Box, StackProps, HStack } from '@chakra-ui/react';
|
||||
import MyIcon from '@fastgpt/web/components/common/Icon';
|
||||
import { useTranslation } from 'next-i18next';
|
||||
import { PermissionValueType } from '@fastgpt/global/support/permission/type';
|
||||
@@ -15,7 +15,7 @@ const PermissionIconText = ({
|
||||
}: {
|
||||
permission?: `${PermissionTypeEnum}`;
|
||||
defaultPermission?: PermissionValueType;
|
||||
} & FlexProps) => {
|
||||
} & StackProps) => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const per = useMemo(() => {
|
||||
@@ -30,12 +30,10 @@ const PermissionIconText = ({
|
||||
}, [defaultPermission, permission]);
|
||||
|
||||
return PermissionTypeMap[per] ? (
|
||||
<Flex alignItems={'center'} fontSize={fontSize} {...props}>
|
||||
<HStack spacing={1} fontSize={fontSize} {...props}>
|
||||
<MyIcon name={PermissionTypeMap[per]?.iconLight as any} w={w} />
|
||||
<Box ml={'2px'} lineHeight={1}>
|
||||
{t(PermissionTypeMap[per]?.label)}
|
||||
</Box>
|
||||
</Flex>
|
||||
<Box lineHeight={1}>{t(PermissionTypeMap[per]?.label)}</Box>
|
||||
</HStack>
|
||||
) : null;
|
||||
};
|
||||
|
||||
|
Reference in New Issue
Block a user