monorepo packages (#344)

This commit is contained in:
Archer
2023-09-24 18:02:09 +08:00
committed by GitHub
parent a4ff5a3f73
commit 3d7178d06f
535 changed files with 12048 additions and 227 deletions

View File

@@ -0,0 +1,66 @@
import React, { useEffect } from 'react';
import { Box } from '@chakra-ui/react';
import { feConfigs } from '@/store/static';
import { serviceSideProps } from '@/utils/web/i18n';
import { useRouter } from 'next/router';
import Navbar from './components/Navbar';
import Hero from './components/Hero';
import Ability from './components/Ability';
import Choice from './components/Choice';
import Footer from './components/Footer';
import Loading from '@/components/Loading';
import Head from 'next/head';
const Home = ({ homeUrl = '/' }: { homeUrl: string }) => {
const router = useRouter();
if (homeUrl !== '/') {
router.replace(homeUrl);
}
useEffect(() => {
router.prefetch('/app/list');
router.prefetch('/login');
}, []);
return (
<>
<Head>
<title>{feConfigs?.systemTitle || 'FastGPT'}</title>
</Head>
{homeUrl === '/' ? (
<Box id="home" bg={'myWhite.600'} h={'100vh'} overflowY={'auto'} overflowX={'hidden'}>
<Box position={'fixed'} zIndex={10} top={0} left={0} right={0}>
<Navbar />
</Box>
<Box maxW={'1200px'} pt={'70px'} m={'auto'}>
<Hero />
<Ability />
<Box my={[4, 6]}>
<Choice />
</Box>
</Box>
{feConfigs?.show_git && (
<Box bg={'white'}>
<Footer />
</Box>
)}
</Box>
) : (
<Loading />
)}
</>
);
};
export async function getServerSideProps(content: any) {
return {
props: {
...(await serviceSideProps(content)),
homeUrl: process.env.HOME_URL || '/'
}
};
}
export default Home;