Passed
Push — master ( f602d8...7b3414 )
by Huu-Phat
02:55 queued 11s
created

modules/home/components/Certification.js

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 62
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 0
eloc 51
mnd 0
bc 0
fnc 0
dl 0
loc 62
ccs 5
cts 5
cp 1
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import React, { useState } from 'react'
2
import styled from 'styled-components/macro'
3
import CertItem from '~/modules/home/components/certification/CertItem'
4
import CertInfo from '~/modules/home/components/certification/CertInfo'
5
import { CERTIFICATIONS } from '~/modules/home/consts/pages'
6
import { ITEM, INFO } from '~/modules/home/consts/certification'
7
import Header from '~/modules/home/components/common/section/Header'
8
import Anchor from '~/modules/home/components/common/Anchor'
9
import Row from 'react-bootstrap/Row'
10
import Container from 'react-bootstrap/Container'
11
import SectionContainer from '~/modules/home/components/common/section/Container'
12
import { Translate } from 'react-localize-redux'
13
14 1
const Certification = () => {
15 1
  const [itemSelected, setSelectedItem] = useState(1)
16
17 1
  return (
18
    <SectionContainer>
19
      <Anchor id={CERTIFICATIONS} top={-40} />
20
      <Container>
21
        <Header>
22
          <h2>
23
            <Translate id="Certifications and Prizes" />
24
          </h2>
25
        </Header>
26
        <List>
27
          <Row>
28
            {ITEM.map((name, index) => (
29 4
              <CertItem
30
                key={index}
31
                itemSelected={itemSelected}
32
                setSelectedItem={setSelectedItem}
33
                id={index + 1}
34
                name={name}
35
              />
36
            ))}
37
          </Row>
38
          <Row>
39
            {INFO.map((info, index) => (
40 4
              <CertInfo
41
                key={index}
42
                itemSelected={itemSelected}
43
                id={index + 1}
44
                title={info.title}
45
                content={info.content}
46
              />
47
            ))}
48
          </Row>
49
        </List>
50
      </Container>
51
    </SectionContainer>
52
  )
53
}
54
55
export default Certification
56
57
const List = styled.ul`
58
  position: relative;
59
  list-style-type: none;
60
  height: 360px;
61
`
62