From 8765d94b31eca1e0a43a0946eb0874380796ada4 Mon Sep 17 00:00:00 2001 From: Pierre Date: Mon, 1 Feb 2021 16:51:57 +0100 Subject: [PATCH] fix --- src/components/PreviewProject.tsx | 30 ++++++++++++++++++++++++++---- src/pages/project/public/index.tsx | 24 +----------------------- 2 files changed, 27 insertions(+), 27 deletions(-) diff --git a/src/components/PreviewProject.tsx b/src/components/PreviewProject.tsx index cddae500ba..64511d62eb 100644 --- a/src/components/PreviewProject.tsx +++ b/src/components/PreviewProject.tsx @@ -1,9 +1,9 @@ import React from 'react' -import { Box, Spinner } from '@chakra-ui/core' -import { Project } from '@prisma/client' +import { Box, Spinner, Icon, Text, Avatar } from '@chakra-ui/core' +import { Project, User } from '@prisma/client' interface Props { - project: Project + project: Project & { user: User } } const PreviewProject = (props: Props) => { @@ -11,9 +11,31 @@ const PreviewProject = (props: Props) => { {!props.project ? ( + ) : props.project.thumbnail ? ( + {props.project.projectName} ) : ( - {props.project.projectName} + + + No screenshot for this project + )} + + + {props.project.projectName} + + + {props.project.user.name} + + ) } diff --git a/src/pages/project/public/index.tsx b/src/pages/project/public/index.tsx index 0b1f02088c..348c56942e 100644 --- a/src/pages/project/public/index.tsx +++ b/src/pages/project/public/index.tsx @@ -5,7 +5,6 @@ import { Box, SimpleGrid, PseudoBox, - Avatar, RadioGroup, Radio, Spinner, @@ -108,7 +107,7 @@ const ProjectList = () => { ) : projects && projects?.project.length > 0 ? ( - + {projects?.project.map((e: Project & { user: User }, i: number) => radioValue === 'all' ? ( { key={i} > - - {e.projectName} - - - {e.user.name} - ) : ( radioValue === e.tag && ( @@ -153,16 +141,6 @@ const ProjectList = () => { key={i} > - {e.projectName} - - - {e.user.name} - ) ),