Skip to content

Commit

Permalink
finally fixed the reloading issue
Browse files Browse the repository at this point in the history
  • Loading branch information
joergreichert committed Jul 18, 2024
1 parent 1e3d17f commit 08c39ac
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/components/Overlay/OverlayTop/index.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React, { FC } from 'react';
import styled from 'styled-components';
import { isMobile } from 'react-device-detect';
import { Link } from "react-router-dom";
import { useHistory } from 'react-router';

import OverlayTitle from '../OverlayTitle/';
import OverlayEvent from '../OverlayEvent/';
Expand Down Expand Up @@ -49,6 +49,7 @@ const StyledWrapper = styled.div`
`;

const OverlayTop: FC = () => {
const history = useHistory();
const { closeOverlay } = useActions();
const { intro, eventNote, whatsNew } = content;

Expand All @@ -60,12 +61,12 @@ const OverlayTop: FC = () => {
<OverlayTitle size='xxl' title={title} />
<img style={{ height: 160 }} src='images/leipzig-giesst-logo.png' />
{!isMobile && (<div style={{ width: '60%', fontSize: '16pt', fontStyle: 'bold', color: 'blue' }}>
Kommender Termin: <Link to={"/event/20240722_umweltminister"}>Am Montag, den 22. Juli, 16:00, kommt uns der sächsische Umweltminister im Hildegarten besuchen.</Link><br /><br />Alle Gießevents findet ihr ab sofort <Link to="/events">links in der Seitenleiste</Link> und auf der Karte.
Kommender Termin: <a style={{ cursor: 'pointer', textDecoration: 'underline' }} onClick={() => { history.push("/event/20240722_umweltminister")}}>Am Montag, den 22. Juli, 16:00, kommt uns der sächsische Umweltminister im Hildegarten besuchen.</a><br /><br />Alle Gießevents findet ihr ab sofort <a style={{ cursor: 'pointer', textDecoration: 'underline' }} onClick={() => { history.push("/events")}}>links in der Seitenleiste</a> und auf der Karte.
</div>)}
</Wrapper>
<OverlayTitle size='small' title={""} />
{isMobile && (<div style={{ paddingLeft: '40px', paddingBottom: '20px', width: '60%', fontSize: '16pt', fontStyle: 'bold', color: 'blue' }}>
Kommender Termin: <Link to={"/event/20240722_umweltminister"}>Am Montag, den 22. Juli, 16:00, kommt uns der sächsische Umweltminister im Hildegarten besuchen.</Link><br /><br />Alle Gießevents findet ihr ab sofort <Link to="/events">links in der Seitenleiste</Link> und auf der Karte.
Kommender Termin: <a style={{ cursor: 'pointer', textDecoration: 'underline' }} onClick={() => { history.push("/event/20240722_umweltminister")}}>Am Montag, den 22. Juli, 16:00, kommt uns der sächsische Umweltminister im Hildegarten besuchen.</a><br /><br />Alle Gießevents findet ihr ab sofort <a style={{ cursor: 'pointer', textDecoration: 'underline' }} onClick={() => { history.push("/events")}}>links in der Seitenleiste</a> und auf der Karte.
</div>)}
<OverlayTitle size='xxl' title={subline} />
{isMobile && <OverlayTitle size='medium' title={disclaimer} />}
Expand Down
5 changes: 4 additions & 1 deletion src/components/Sidebar/SidebarEvents/index.tsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
import React, { FC } from 'react';
import { useHistory } from 'react-router';

import SidebarTitle from '../SidebarTitle/';
import ExpandablePanel from '../../ExpandablePanel';
import SmallParagraph from '../../SmallParagraph';
import { useEventsGeoJson } from '../../../utils/hooks/useEventsGeoJson';

const SidebarEvents: FC = () => {
const history = useHistory();

const { isLoading: isLoadingEventsGeojson, data: eventsGeoJson } = useEventsGeoJson();
if (isLoadingEventsGeojson) {
return (<div>Laden...</div>)
Expand All @@ -20,7 +23,7 @@ const SidebarEvents: FC = () => {
<ExpandablePanel isExpanded title={feature.properties.name} key={feature.properties.id}>
<SmallParagraph>{new Date(feature.properties.date).toLocaleDateString()}{feature.properties.start ? ', ' + feature.properties.start : ''}{feature.properties.end ? ' - ' + feature.properties.end : ''}</SmallParagraph>
<SmallParagraph>{feature.properties.address ? feature.properties.address : ''}</SmallParagraph>
<SmallParagraph><a style={{ cursor: 'pointer' }} href={"/event/" + feature.properties.id}>Zum Event</a></SmallParagraph>
<SmallParagraph><div style={{ cursor: 'pointer', textDecoration: 'underline' }} onClick={() => { history.push("/event/" + feature.properties.id)}}>Zum Event</div></SmallParagraph>
</ExpandablePanel>
))}
</>
Expand Down

0 comments on commit 08c39ac

Please sign in to comment.