File tree Expand file tree Collapse file tree
frontend/src/components/projects/ProjectsGridItem Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -118,6 +118,24 @@ const ProjectsGridItem = ({
118118 }
119119 }
120120
121+ const styling = {
122+ punchlineMaxLength : 150 ,
123+ }
124+
125+ const stylingModifiers = styleRules => {
126+ if ( showTableLocation ) {
127+ styleRules . punchlineMaxLength = styleRules . punchlineMaxLength - 25
128+ }
129+ if ( showScore ) {
130+ styleRules . punchlineMaxLength = styleRules . punchlineMaxLength - 25
131+ }
132+ if ( showReviewers ) {
133+ styleRules . punchlineMaxLength = styleRules . punchlineMaxLength - 50
134+ }
135+ }
136+
137+ stylingModifiers ( styling )
138+
121139 return (
122140 < Grid item xs = { 12 } sm = { 6 } md = { 4 } style = { { display : 'flex' } } >
123141 < Card
@@ -167,8 +185,9 @@ const ProjectsGridItem = ({
167185 </ div >
168186 { project ?. punchline && (
169187 < Typography variant = "body1" component = "p" >
188+ { showTableLocation && showScore }
170189 { _ . truncate ( project . punchline , {
171- length : 150 ,
190+ length : styling . punchlineMaxLength ,
172191 } ) }
173192 </ Typography >
174193 ) }
You can’t perform that action at this time.
0 commit comments