Skip to content
This repository was archived by the owner on Aug 6, 2024. It is now read-only.

Commit 06b2d4e

Browse files
authored
Merge pull request #76 from hifis-net/70-aspect_ratios
Fix aspect ratio for iOS and MacOS
2 parents ffb24af + a939e4e commit 06b2d4e

File tree

3 files changed

+54
-29
lines changed

3 files changed

+54
-29
lines changed

deployment/helmholtz/styles/index.css

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,6 @@ header input {
3737
background-color: #cdeefb;
3838
}
3939

40-
#hgf-scroll-container {
41-
display: flex;
42-
height: 200px;
43-
}
44-
4540
.simplebar-track.simplebar-horizontal {
4641
height: 7px !important;
4742
border-bottom: 1px solid #002864;
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
// SPDX-FileCopyrightText: 2022 Christian Meeßen (GFZ) <[email protected]>
2+
// SPDX-FileCopyrightText: 2022 Helmholtz Centre Potsdam - GFZ German Research Centre for Geosciences
3+
// SPDX-FileCopyrightText: 2022 Marc Hanisch (GFZ) <[email protected]>
4+
//
5+
// SPDX-License-Identifier: EUPL-1.2
6+
7+
import {getUrlFromLogoId} from '~/utils/editOrganisation'
8+
9+
import Link from 'next/link'
10+
import {OrganisationForOverview} from '~/types/Organisation'
11+
12+
/* eslint-disable @next/next/no-img-element */
13+
14+
export default function HorizontalScrollContainer(
15+
{organisations}: {organisations: OrganisationForOverview[]}
16+
) {
17+
return (
18+
<div
19+
style={{
20+
display: 'flex',
21+
height: '200px'
22+
}}
23+
>
24+
{
25+
organisations.map(item => {
26+
return(
27+
<Link
28+
key={`link_${item.name}`}
29+
href={`/organisations/${item.rsd_path}`}
30+
passHref
31+
>
32+
<img
33+
alt={item.name}
34+
src={getUrlFromLogoId(item.logo_id) ?? undefined}
35+
className="p-10 hover:cursor-pointer"
36+
style = {{
37+
width: 'auto',
38+
objectFit: 'contain',
39+
aspectRatio: 'auto'
40+
}}
41+
/>
42+
</Link>
43+
)
44+
})
45+
}
46+
</div>
47+
)
48+
}

frontend/components/home/helmholtz/ParticipatingOrganisations.tsx

Lines changed: 6 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -6,32 +6,31 @@
66

77
/* eslint-disable @next/next/no-img-element */
88
import React, {useEffect, useState, useRef} from 'react'
9-
import Link from 'next/link'
109
import SimpleBar from 'simplebar-react'
1110
import 'simplebar/dist/simplebar.min.css'
1211

1312
import {OrganisationForOverview} from '~/types/Organisation'
1413

1514
/*! purgecss start ignore */
1615
import 'aos/dist/aos.css'
17-
import {getUrlFromLogoId} from '~/utils/editOrganisation'
1816
import {IconButton} from '@mui/material'
1917
import {ChevronLeft, ChevronRight} from '@mui/icons-material'
18+
import HorizontalScrollContainer from './HorizontalScrollContainer'
2019
/*! purgecss end ignore */
2120

2221
export default function ParticipatingOrganisations(
2322
{organisations, sbRef}: {organisations: OrganisationForOverview[], sbRef: any},
2423
) {
2524
const commonButtonStyle = {
2625
fontSize: '2.5rem',
27-
color: 'primary.contrastText',
26+
color: 'text.primary',
2827
backgroundColor: 'white',
2928
position: 'absolute',
3029
transform: 'translateY(-50%)',
3130
top: '50%',
3231
'&:hover': {
3332
color: 'white',
34-
backgroundColor: 'primary.contrastText',
33+
backgroundColor: 'text.primary',
3534
},
3635
}
3736

@@ -76,27 +75,10 @@ export default function ParticipatingOrganisations(
7675
ref={sbRef}
7776
autoHide={false}
7877
forceVisible="x"
79-
style={{maxHeight: 300}}
8078
>
81-
<div id="hgf-scroll-container">
82-
{
83-
organisations.map(item => {
84-
return(
85-
<Link
86-
key={`link_${item.name}`}
87-
href={`/organisations/${item.rsd_path}`}
88-
passHref
89-
>
90-
<img
91-
alt={item.name}
92-
src={getUrlFromLogoId(item.logo_id) ?? undefined}
93-
className="p-10 hover:cursor-pointer"
94-
/>
95-
</Link>
96-
)
97-
})
98-
}
99-
</div>
79+
<HorizontalScrollContainer
80+
organisations={organisations}
81+
/>
10082
</SimpleBar>
10183

10284
<IconButton

0 commit comments

Comments
 (0)