File tree 1 file changed +15
-15
lines changed
src/components/Dashboard/MonthlyGoal
1 file changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -159,6 +159,16 @@ const MonthlyGoal = ({
159
159
}
160
160
: null ;
161
161
const annotationId = useId ( ) ;
162
+ const annotationNode = annotation && (
163
+ < Typography
164
+ id = { annotationId }
165
+ color = { annotation . warning ? 'statusWarning.main' : 'textSecondary' }
166
+ variant = "body2"
167
+ >
168
+ < span aria-hidden > *</ span >
169
+ { annotation . label }
170
+ </ Typography >
171
+ ) ;
162
172
163
173
return (
164
174
< >
@@ -250,6 +260,8 @@ const MonthlyGoal = ({
250
260
</ >
251
261
) }
252
262
</ Typography >
263
+ { /* Without the HI card there is enough space for the annotation so display it here */ }
264
+ { annotation && ! showHealthIndicator && annotationNode }
253
265
{ annotation ?. warning && (
254
266
< Button
255
267
component = { NextLink }
@@ -379,22 +391,10 @@ const MonthlyGoal = ({
379
391
</ Grid >
380
392
) }
381
393
</ Hidden >
382
- { annotation && (
394
+ { /* With the HI card there isn't enough space for the annotation next to the monthly goal so display it here */ }
395
+ { annotation && showHealthIndicator && (
383
396
< Hidden smDown >
384
- < Grid item >
385
- < Typography
386
- id = { annotationId }
387
- color = {
388
- annotation . warning
389
- ? 'statusWarning.main'
390
- : 'textSecondary'
391
- }
392
- variant = "body2"
393
- >
394
- < span aria-hidden > *</ span >
395
- { annotation . label }
396
- </ Typography >
397
- </ Grid >
397
+ < Grid item > { annotationNode } </ Grid >
398
398
</ Hidden >
399
399
) }
400
400
</ Grid >
You can’t perform that action at this time.
0 commit comments