-
Notifications
You must be signed in to change notification settings - Fork 1
/
Education.tsx
42 lines (36 loc) · 1.3 KB
/
Education.tsx
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
import React, { FC } from 'react'
import { EducationPhase } from '../../components/EducationPhase/EducationPhase'
import { UnderlinedTitle } from '../../components/UnderlinedTitle/UnderlinedTitle'
import { LanguageConsumer } from '../../context/IsSpanishContext'
import { i18n } from '../../i18n'
type EducationProps = {
className?: string
}
const englishLang = {
degree_in_computer_engineering: 'Degree in Computer Engineering',
university_of_la_laguna: 'University of La Laguna',
education: 'Education',
}
const spanishLang: typeof englishLang = {
degree_in_computer_engineering: 'Grado en Ingeniería Informática',
university_of_la_laguna: 'Universidad de la Laguna',
education: 'Formación',
}
export const Education: FC<EducationProps> = ({ className }) => (
<LanguageConsumer>
{(lang) => {
const getLabel = i18n(lang, { englishLang, spanishLang })
return (
<section className={className}>
<UnderlinedTitle>{getLabel('education')}</UnderlinedTitle>
<EducationPhase
educationName={getLabel('degree_in_computer_engineering')}
universityName={getLabel('university_of_la_laguna')}
startDate={new Date('09/05/2013')}
endDate={new Date('07/30/2017')}
/>
</section>
)
}}
</LanguageConsumer>
)