Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions web-ui/src/pages/HomePage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,11 @@ export default function HomePage() {
const kudosStyle = birthdays.length == 0 &&
anniversaries.length == 0 ? {} : { width: '450px' };

// Determine the X position of the birthday confetti. If there aren't any
// anniversaries, it will be the left side. If there are anniversaries, we
// need it in the middle. Confetti X position ranges from 0 to 1.
const xPos = anniversaries.length > 0 ? .5 : .25;

return (
<div className="home-page">
<div className="celebrations">
Expand All @@ -95,13 +100,13 @@ export default function HomePage() {
/>
) : (
<Grid container spacing={2} style={{ padding: '0 20px 0 20px' }}>
{ anniversaries.length > 0 && (
{ anniversaries.length > 0 && (
<Grid item>
<Anniversaries anniversaries={anniversaries} />
</Grid>) }
{ birthdays.length > 0 && (
<Grid item>
<Birthdays birthdays={birthdays} />
<Birthdays birthdays={birthdays} xPos={xPos} />
</Grid>) }
<Grid item style={kudosStyle}>
<PublicKudos />
Expand Down
Loading