Skip to content

Commit

Permalink
feat(web): index 增加 create project 按钮
Browse files Browse the repository at this point in the history
  • Loading branch information
xinyao27 committed Jul 1, 2022
1 parent fb502de commit c762ab3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
5 changes: 4 additions & 1 deletion packages/web/src/components/projectCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ const ProjectCard: FC<Props> = ({ project }) => {

return (
<NextLink href={`/${project.id}/profile`}>
<Card w="sm">
<Card
minW="sm"
w="full"
>
<Flex gap="6">
<Avatar
name={project.name}
Expand Down
14 changes: 13 additions & 1 deletion packages/web/src/pages/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
import { SimpleGrid } from '@chakra-ui/react'
import { Button, Flex, SimpleGrid } from '@chakra-ui/react'
import type { Setting } from '@prisma/client'
import type { ProjectWithEventCount } from 'common'
import type { GetServerSideProps, NextPage } from 'next'
import { RiAddLine } from 'react-icons/ri'
import NextLink from 'next/link'
import ProjectCard from '~/components/projectCard'
import Wrapper from '~/components/wrapper'
import { serviceGetSetting } from '~/services/bootstrap'
Expand Down Expand Up @@ -38,8 +40,18 @@ export const getServerSideProps: GetServerSideProps<Props> = async() => {
const Home: NextPage<Props> = ({ projects }) => {
return (
<Wrapper>
<Flex justify="end">
<NextLink href="/create-project">
<Button
leftIcon={<RiAddLine />}
>
Create a Project
</Button>
</NextLink>
</Flex>
<SimpleGrid
columns={3}
mt="4"
spacing="8"
>
{
Expand Down

0 comments on commit c762ab3

Please sign in to comment.