@@ -9,7 +9,7 @@ import MyBirthday from '../components/celebrations/MyBirthday';
9
9
import { AppContext } from '../context/AppContext' ;
10
10
import { selectCsrfToken , selectCurrentUser } from '../context/selectors' ;
11
11
import { sortAnniversaries , sortBirthdays } from '../context/util' ;
12
- import { Button } from '@mui/material' ;
12
+ import { Button , Grid } from '@mui/material' ;
13
13
14
14
import './HomePage.css' ;
15
15
@@ -76,6 +76,13 @@ export default function HomePage() {
76
76
return document . cookie . indexOf ( "OJWT=" ) != - 1 ;
77
77
}
78
78
79
+ // This width matches the birthdays-card and anniversaries-card style.
80
+ // However, we do not want to set this width on the PublicKudos css as it is
81
+ // used elsewhere and does not need to have it's width restricted. This only
82
+ // applies if if we have birthdays or anniversaries to display on this page.
83
+ const kudosStyle = birthdays . length == 0 &&
84
+ anniversaries . length == 0 ? { } : { width : '450px' } ;
85
+
79
86
return (
80
87
< div className = "home-page" >
81
88
< div className = "celebrations" >
@@ -87,11 +94,19 @@ export default function HomePage() {
87
94
myAnniversary = { myAnniversaryData }
88
95
/>
89
96
) : (
90
- < >
91
- { anniversaries . length > 0 && ( < Anniversaries anniversaries = { anniversaries } /> ) }
92
- { birthdays . length > 0 && ( < Birthdays birthdays = { birthdays } /> ) }
93
- < PublicKudos />
94
- </ >
97
+ < Grid container spacing = { 2 } style = { { padding : '0 20px 0 20px' } } >
98
+ { anniversaries . length > 0 && (
99
+ < Grid item >
100
+ < Anniversaries anniversaries = { anniversaries } />
101
+ </ Grid > ) }
102
+ { birthdays . length > 0 && (
103
+ < Grid item >
104
+ < Birthdays birthdays = { birthdays } />
105
+ </ Grid > ) }
106
+ < Grid item style = { kudosStyle } >
107
+ < PublicKudos />
108
+ </ Grid >
109
+ </ Grid >
95
110
) }
96
111
</ div >
97
112
{ checkForImpersonation ( ) &&
0 commit comments