Skip to content

Commit

Permalink
Add placeholder to fill empty space when no event is selected
Browse files Browse the repository at this point in the history
  • Loading branch information
chopan050 committed Jan 25, 2024
1 parent deb49bc commit a81c0cd
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/components/Frontpage/Frontpage.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@
}
.content .calendar .yearHeader button {
height: 90px;
width: 49.5px;
width: 49px;
font-size: x-large;
}
.content .calendar .monthHeader th {
Expand Down
16 changes: 12 additions & 4 deletions src/components/Frontpage/eventCalendar.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -284,8 +284,8 @@ export default function EventCalendar({ events, location, lang }) {
}

return (
<div style={{position: "relative"}} className={cx('calendar', 'flex')}>
<table>
<div style={{ position: "relative" }} className={cx('calendar', 'flex')}>
<table style={{ margin: "auto" }}>
<thead>
<tr className={cx("yearHeader")}>
<td rowSpan='3'>
Expand All @@ -305,9 +305,17 @@ export default function EventCalendar({ events, location, lang }) {
)}
</tbody>
</table>
<div style={{width: "336px", height: "570px", overflow: "scroll"}}>
<div style={{ width: "336px", height: "570px", overflow: "scroll", margin: "auto" }}>
{
selectedEventIndex !== -1 && <NewsItem item={events[selectedEventIndex]} location={location} lang={lang}/>
selectedEventIndex !== -1
? <NewsItem item={events[selectedEventIndex]} location={location} lang={lang}/>
: <div style={{ height: "100%", width: "100%", padding: "10%", display: "flex", alignItems: "center", backgroundColor: "#eeeeee" }}>
<p style={{ fontSize: "24px", textAlign: "center" }}>
<Translate>
<Swedish>Klicka på en händelse för att visa mer information</Swedish>
<English>Click on an event to display more information</English>
</Translate></p>
</div>
}
</div>
{(widgetWeekGroups
Expand Down
4 changes: 2 additions & 2 deletions src/components/Frontpage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -249,8 +249,8 @@ const Frontpage = ({ location, lang }) =>
{/* Title */}
<h2 id="sections_intro">
<Translate>
<Swedish>Evenemangs<span>Kalender</span></Swedish>
<English>Event <span>Calendar</span></English>
<Swedish>Evenemangskalender</Swedish>
<English>Event Calendar</English>
</Translate>
</h2>

Expand Down

0 comments on commit a81c0cd

Please sign in to comment.