-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Expand file tree
/
Copy pathCompaniesBanner.js
More file actions
190 lines (180 loc) · 4.65 KB
/
CompaniesBanner.js
File metadata and controls
190 lines (180 loc) · 4.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
import './CompaniesBanner.scss';
import { Banner } from '../Banner/Banner';
import { BodyText } from '../BodyText/BodyText';
import { ContentLiftup } from '../ContentLiftup/ContentLiftup';
import Element from '../Element/Element';
import { Image } from '../Image/Image';
import { Link } from 'gatsby';
import { PropTypes } from 'prop-types';
import React from 'react';
import snakeCase from 'lodash/fp/snakeCase';
import { useTranslation } from 'react-i18next';
import i18n from 'i18next';
import getTranslationPath from '../../utils/getTranslationPath';
const partners = [
{
image: { name: 'uoh_centre.svg', alt: 'Helsingin yliopisto' },
url: 'https://www.helsinki.fi/',
},
{
image: { name: 'houston2.svg', alt: 'Houston inc.' },
url: 'https://www.houston-inc.com/careers',
},
{
image: { name: 'terveystalo.svg', alt: 'Terveystalo' },
url: 'https://www.terveystalo.com/',
},
{
image: { name: 'elisa.svg', alt: 'Elisa' },
url: 'https://corporate.elisa.fi/rekrytointi/',
},
{
image: { name: 'unity.svg', alt: 'Unity' },
url: 'https://www.instagram.com/unitytechnologies/?hl=en',
},
{
image: { name: 'konecranes.svg', alt: 'Konecranes' },
url: 'https://careers.konecranes.com/Konecranes/',
},
{
image: { name: 'smartly_io.svg', alt: 'Smartly' },
url: 'https://www.smartly.io/careers/',
},
];
/* All logos must be in SVG format */
const inChallenge = [
'Tivia',
'Relex',
'Smartly.io',
'Eficode',
'Sympa',
'Cinia',
'AppGyver',
'Codento',
'Taito united',
'Emblica',
'Kodan',
'UpCloud',
'Perfektio',
'Blok',
'G-Works',
'Webscale',
'Siili',
'Ilmatieteenlaitos',
'Futurice',
'Visma',
'Platonic Partnership',
'Omnia',
'Tietotalo',
'Circles',
'Nordcloud',
'Wunderdog',
'Gofore',
'Nortal Oy',
'NurseBuddy',
'Wolt',
'Pori',
'Motley',
'Bonsky Digital',
'Plan Brothers',
'Integrify',
'Rentle',
'Compile',
'Telia',
'Umbrella Interactive',
'Tabella',
'Nextup',
'Kela',
'Geometrix',
'Netyourself',
'Vero',
'Hiq',
'Resilient E',
'Neemia',
'Bubblin',
'Zaibatsu',
];
export const CompaniesBanner = ({ isFrontPage, lang }) => {
const { t } = useTranslation();
const isRtl = i18n.dir() === 'rtl'
return (
<Banner
backgroundColor={isFrontPage && 'var(--color-background)'}
className="spacing--after"
id="challenge"
>
<Element className="container" flex>
<BodyText
centered
className={`col-4 ${isRtl ? 'push-left-3' : 'push-right-3'} challenge-title`}
text={t('challengePage:coOperationTitle')}
/>
<Element
flex
spaceBetween
className={`col-6 ${isRtl ? 'push-left-2' : 'push-right-2'} flex-fix-aligning space-between--mobile`}
>
{partners.map((company, i) => (
<ContentLiftup
key={company.url}
small
applyPadding
companyPath={company.url}
image={{
src: require(
`../../images/company_logos/${company.image.name}`
),
alt: company.image.alt,
}}
className={`col-3 col-5--mobile col-5--tablet`}
/>
))}
</Element>
{!isFrontPage && (
<>
<BodyText
centered
className={`col-4 spacing ${isRtl ? 'push-left-3' : 'push-right-3'} challenge-title`}
text={t('challengePage:participantsTitle')}
/>
<Element
flex
className="col-9 flex-fix-aligning space-between--mobile"
>
{inChallenge.map((company) => (
<Image
key={company}
contain
src={require(
`../../images/company_logos/${snakeCase(company)}.svg`
)}
alt={company}
className={`company__logo ${isRtl ? 'push-left-1' : 'push-right-1'} col-3--mobile col-3--tablet`}
backdrop
/>
))}
</Element>
</>
)}
{isFrontPage && (
<Element flex spaceAround className="col-10 spacing">
<Link
className="about__challenge-button"
to={getTranslationPath(lang, '/challenge')}
>
{t('challengePage:infoButton')}
</Link>
</Element>
)}
</Element>
</Banner>
);
};
CompaniesBanner.defaultProps = {
isFrontPage: false,
lang: 'fi',
};
CompaniesBanner.propTypes = {
isFrontPage: PropTypes.bool,
lang: PropTypes.string.isRequired,
};