Skip to content

Commit 1dc2d49

Browse files
authored
feat: added OTHER_INFO from tprek to venue pages (#299)
1 parent 4f30207 commit 1dc2d49

7 files changed

Lines changed: 139 additions & 1 deletion

File tree

apps/sports-helsinki/src/domain/venue/venueContent/VenueContent.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
} from 'react-helsinki-headless-cms';
1515
import VenueInfo from '../venueInfo/VenueInfo';
1616
import VenueLocation from '../venueLocation/VenueLocation';
17+
import VenueOtherInfo from '../venueOtherInfo/VenueOtherInfo';
1718
import styles from './venueContent.module.scss';
1819

1920
interface Props {
@@ -50,6 +51,7 @@ const VenueContent: React.FC<Props> = ({ venue, className }) => {
5051
</HtmlToReact>
5152
</div>
5253
)}
54+
<VenueOtherInfo venue={venue} />
5355
<ShareLinks title={t('venue:shareLinks.title')} />
5456
<VenueLocation venue={venue} />
5557
</div>

apps/sports-helsinki/src/domain/venue/venueContent/venueContent.module.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@
3535

3636
.description {
3737
line-height: 1.5;
38-
38+
white-space: pre-line;
3939
p {
4040
font-size: var(--description-font-size);
4141
margin: 1rem 0;
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
import { Text, useVenueTranslation } from '@events-helsinki/components';
2+
import type { Venue } from '@events-helsinki/components';
3+
import React from 'react';
4+
import styles from './venueOtherInfo.module.scss';
5+
6+
const VenueOtherInfo = ({ venue: { connections } }: { venue: Venue }) => {
7+
const venueOtherInfoContainer = React.useRef<HTMLDivElement | null>(null);
8+
const { t } = useVenueTranslation();
9+
const otherInfoConnections = connections?.filter(
10+
(item) => item?.sectionType === 'OTHER_INFO'
11+
);
12+
if (otherInfoConnections.length > 0) {
13+
return (
14+
<div className={styles.venueOtherInfo} ref={venueOtherInfoContainer}>
15+
<h2 className={styles.descriptionTitle}>
16+
{t('venue:otherInfo.title')}
17+
</h2>
18+
{otherInfoConnections?.map((connection, i) => (
19+
<Text
20+
className={styles.description}
21+
key={`contact-details-other-info${i}`}
22+
>
23+
{connection?.name}
24+
</Text>
25+
))}
26+
</div>
27+
);
28+
}
29+
return null;
30+
};
31+
32+
export default VenueOtherInfo;
Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
@import 'src/styles/breakpoints';
2+
3+
.venueOtherInfo {
4+
padding: 0;
5+
font-size: var(--fontsize-body-l);
6+
7+
display: grid;
8+
grid-template-columns: 1fr;
9+
10+
.contentWrapper {
11+
& > div {
12+
margin-bottom: var(--spacing-l);
13+
}
14+
}
15+
16+
button {
17+
display: flex;
18+
justify-content: center;
19+
align-items: center;
20+
margin: var(--spacing-s) 0;
21+
color: var(--color-secondary-link);
22+
outline: none !important;
23+
font-weight: 600;
24+
padding: 0;
25+
svg g * {
26+
color: var(--color-secondary-link);
27+
}
28+
}
29+
30+
button:hover {
31+
text-decoration: underline;
32+
}
33+
34+
.focusVisible {
35+
&:focus {
36+
outline: 2px solid var(--color-primary-black) !important;
37+
outline-offset: -2px;
38+
}
39+
}
40+
}
41+
42+
.descriptionTitle {
43+
font-size: var(--fontsize-heading-m);
44+
font-weight: 500;
45+
margin: 2.25rem 0 1rem;
46+
}
47+
48+
.buyButtonWrapper {
49+
margin-top: var(--spacing-s);
50+
}
51+
52+
a.link {
53+
&,
54+
&:visited {
55+
color: var(--color-secondary-link);
56+
}
57+
58+
svg g * {
59+
color: var(--color-secondary-link);
60+
}
61+
62+
margin: var(--spacing-xs) 0;
63+
padding: 0;
64+
}
65+
66+
.list {
67+
display: flex;
68+
flex-direction: column;
69+
margin: 0;
70+
padding: 0;
71+
list-style-type: none;
72+
white-space: pre;
73+
line-height: $lineheight-l;
74+
font-size: $fontsize-body-l;
75+
& > li:not(:last-child) {
76+
margin-bottom: $spacing-s;
77+
}
78+
}
79+
80+
.description {
81+
line-height: 1.5;
82+
83+
p {
84+
font-size: var(--description-font-size);
85+
margin: 1rem 0;
86+
}
87+
88+
a {
89+
text-decoration: underline;
90+
font-size: var(--description-font-size);
91+
}
92+
a:hover {
93+
color: var(--color-coat-of-arms-dark);
94+
}
95+
}

packages/common-i18n/src/locales/en/venue.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"description": {
99
"title": "Description"
1010
},
11+
"otherInfo": {
12+
"title": "Location extra info"
13+
},
1114
"location": {
1215
"directionsGoogle": "Directions (Google)",
1316
"directionsHSL": "Directions (HSL)"

packages/common-i18n/src/locales/fi/venue.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"description": {
99
"title": "Kuvaus"
1010
},
11+
"otherInfo": {
12+
"title": "Paikan lisätiedot"
13+
},
1114
"location": {
1215
"directionsGoogle": "Reittiohjeet (Google)",
1316
"directionsHSL": "Reittiohjeet (HSL)"

packages/common-i18n/src/locales/sv/venue.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@
88
"description": {
99
"title": "Beskrivning"
1010
},
11+
"otherInfo": {
12+
"title": "Plats ytterligare info"
13+
},
1114
"location": {
1215
"directionsGoogle": "Rutter (Google)",
1316
"directionsHSL": "Rutter (HRT)"

0 commit comments

Comments
 (0)