This commit is contained in:
archer
2023-07-25 21:53:26 +08:00
parent c5f50b65c9
commit b367082d38
25 changed files with 230 additions and 276 deletions

View File

@@ -14,6 +14,7 @@ import MyIcon from '@/components/Icon';
import PageContainer from '@/components/PageContainer';
import Loading from '@/components/Loading';
import BasicEdit from './components/BasicEdit';
import { serviceSideProps } from '@/utils/i18n';
const AdEdit = dynamic(() => import('./components/AdEdit'), {
ssr: false,
@@ -188,7 +189,7 @@ export async function getServerSideProps(context: any) {
const currentTab = context?.query?.currentTab || TabEnum.basicEdit;
return {
props: { currentTab }
props: { currentTab, ...(await serviceSideProps(context)) }
};
}

View File

@@ -16,17 +16,21 @@ import { AddIcon } from '@chakra-ui/icons';
import { delModelById } from '@/api/app';
import { useToast } from '@/hooks/useToast';
import { useConfirm } from '@/hooks/useConfirm';
import dynamic from 'next/dynamic';
import { serviceSideProps } from '@/utils/i18n';
import { useTranslation } from 'next-i18next';
import dynamic from 'next/dynamic';
import MyIcon from '@/components/Icon';
import PageContainer from '@/components/PageContainer';
import Avatar from '@/components/Avatar';
const CreateModal = dynamic(() => import('./component/CreateModal'));
import styles from './index.module.scss';
import MyTooltip from '@/components/MyTooltip';
const CreateModal = dynamic(() => import('./component/CreateModal'));
import styles from './index.module.scss';
const MyApps = () => {
const { toast } = useToast();
const { t } = useTranslation();
const theme = useTheme();
const router = useRouter();
const { myApps, loadMyModels } = useUserStore();
@@ -69,7 +73,7 @@ const MyApps = () => {
<PageContainer>
<Flex pt={3} px={5} alignItems={'center'}>
<Box flex={1} className="textlg" letterSpacing={1} fontSize={'24px'} fontWeight={'bold'}>
{t('app.My Apps')}
</Box>
<Button leftIcon={<AddIcon />} variant={'base'} onClick={onOpenCreateModal}>
@@ -167,4 +171,12 @@ const MyApps = () => {
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content))
}
};
}
export default MyApps;