Skip to content

Commit bade29a

Browse files
authored
Merge pull request #2848 from objectcomputing/bugfix-2847/confetti-location
Dynamically determine the confetti location based on existence of …
2 parents 3f5563a + 9a9a961 commit bade29a

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

web-ui/src/pages/HomePage.jsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,11 @@ export default function HomePage() {
8383
const kudosStyle = birthdays.length == 0 &&
8484
anniversaries.length == 0 ? {} : { width: '450px' };
8585

86+
// Determine the X position of the birthday confetti. If there aren't any
87+
// anniversaries, it will be the left side. If there are anniversaries, we
88+
// need it in the middle. Confetti X position ranges from 0 to 1.
89+
const xPos = anniversaries.length > 0 ? .5 : .25;
90+
8691
return (
8792
<div className="home-page">
8893
<div className="celebrations">
@@ -95,13 +100,13 @@ export default function HomePage() {
95100
/>
96101
) : (
97102
<Grid container spacing={2} style={{ padding: '0 20px 0 20px' }}>
98-
{ anniversaries.length > 0 && (
103+
{ anniversaries.length > 0 && (
99104
<Grid item>
100105
<Anniversaries anniversaries={anniversaries} />
101106
</Grid>) }
102107
{ birthdays.length > 0 && (
103108
<Grid item>
104-
<Birthdays birthdays={birthdays} />
109+
<Birthdays birthdays={birthdays} xPos={xPos} />
105110
</Grid>) }
106111
<Grid item style={kudosStyle}>
107112
<PublicKudos />

0 commit comments

Comments
 (0)