1- import { alpha , Box , Card , CardContent , Chip , Stack , Typography , useTheme , useMediaQuery , Link } from '@mui/material' ;
1+ import { alpha , Box , Card , CardContent , Chip , Stack , Typography , useTheme , Link } from '@mui/material' ;
22import { wbsNamePipe , ProjectPreview , wbsPipe , WbsElementStatus } from 'shared' ;
33import { datePipe } from '../../utils/pipes' ;
44import { NERButton } from '../../components/NERButton' ;
@@ -13,7 +13,6 @@ interface ProjectCardProps {
1313
1414const GuestProjectsCard : React . FC < ProjectCardProps > = ( { project } ) => {
1515 const theme = useTheme ( ) ;
16- const isMobilePortrait = useMediaQuery ( '(max-width:600px)' ) ;
1716 const { data : singleProject , isLoading, isError, error } = useSingleProject ( project . wbsNum ) ;
1817 if ( isLoading || ! singleProject ) return < LoadingIndicator /> ;
1918 if ( isError ) return < ErrorPage message = { error . message } /> ;
@@ -24,14 +23,15 @@ const GuestProjectsCard: React.FC<ProjectCardProps> = ({ project }) => {
2423 < Card
2524 variant = "outlined"
2625 sx = { {
27- minWidth : 'fit-content' ,
28- minHeight : 'fit-content' ,
29- width : isMobilePortrait ? '100%' : 'auto' ,
26+ width : '100%' ,
27+ height : '100%' ,
28+ display : 'flex' ,
29+ flexDirection : 'column' ,
3030 background : theme . palette . background . paper ,
3131 borderRadius : 2
3232 } }
3333 >
34- < CardContent sx = { { padding : 2 } } >
34+ < CardContent sx = { { padding : 2 , display : 'flex' , flexDirection : 'column' , flexGrow : 1 } } >
3535 < Stack direction = "row" justifyContent = "space-between" >
3636 < Box width = { '100%' } >
3737 < Box display = "flex" justifyContent = "space-between" alignItems = "center" >
@@ -67,7 +67,7 @@ const GuestProjectsCard: React.FC<ProjectCardProps> = ({ project }) => {
6767 ? `${ singleProject . manager . firstName } ${ singleProject . manager . lastName } `
6868 : 'N/A' }
6969 </ Typography >
70- < Typography fontWeight = { 'regular' } fontSize = { { xs : 14 , sm : 16 } } noWrap >
70+ < Typography fontWeight = { 'regular' } fontSize = { { xs : 14 , sm : 16 } } >
7171 { datePipe ( singleProject . startDate ) +
7272 ' ⟝ ' +
7373 singleProject . duration +
@@ -76,7 +76,18 @@ const GuestProjectsCard: React.FC<ProjectCardProps> = ({ project }) => {
7676 </ Typography >
7777 </ Box >
7878 </ Stack >
79- < Typography > { singleProject . summary } </ Typography >
79+ < Typography
80+ sx = { {
81+ flexGrow : 1 ,
82+ overflow : 'hidden' ,
83+ textOverflow : 'ellipsis' ,
84+ display : '-webkit-box' ,
85+ WebkitLineClamp : 3 ,
86+ WebkitBoxOrient : 'vertical'
87+ } }
88+ >
89+ { singleProject . summary }
90+ </ Typography >
8091 < Link
8192 component = { RouterLink }
8293 to = { `/projects/${ wbsPipe ( project . wbsNum ) } ` }
0 commit comments