Passed
Push — master ( 48350e...a50f9c )
by Tom
02:35
created

src/components/CV/index.js   A

Complexity

Total Complexity 1
Complexity/F 0

Size

Lines of Code 64
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 57
mnd 1
bc 1
fnc 0
dl 0
loc 64
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
rs 10
1
import React from 'react'
2
import PropTypes from 'prop-types'
3
import { connect } from 'react-redux'
4
import Markdown from 'react-markdown'
5
import settings from 'Settings'
6
import Page from '../Page'
7
import WebVersionLink from './WebVersionLink'
8
import TopSection from './TopSection'
9
import CareerSection from './Section/CareerSection'
10
import EduSection from './Section/EduSection'
11
import LanguageSection from './Section/LanguageSection'
12
import Section from './Section'
13
import Block from './Block'
14
import Footer from './Footer'
15
import CVStyle from './index.scss'
16
17
const CV = ({ educationFirst, customSections, url }) => (
18
  <Page className={CVStyle.cv}>
19
    <>
20
      {settings.print_show_web_version_link && url && <WebVersionLink />}
21
      <TopSection />
22
      {educationFirst ? (
23
        <>
24
          <EduSection />
25
          <CareerSection />
26
        </>
27
      ) : (
28
        <>
29
          <CareerSection />
30
          <EduSection />
31
        </>
32
      )}
33
      <LanguageSection />
34
      {customSections &&
35
        customSections.map((item, index) => (
36
          <Section
37
            key={item.section_name}
38
            title={item.section_name}
39
            isBottom={index === customSections.length - 1 && true}
40
          >
41
            <Block>
42
              <Markdown source={item.section_content} />
43
            </Block>
44
          </Section>
45
        ))}
46
      <Footer />
47
    </>
48
  </Page>
49
)
50
51
CV.propTypes = {
52
  educationFirst: PropTypes.bool,
53
  customSections: PropTypes.arrayOf(PropTypes.object),
54
  url: PropTypes.string,
55
}
56
57
const mapStateToProps = (state) => ({
58
  educationFirst: state.userData.education_first,
59
  customSections: state.userData.custom_sections,
60
  url: state.userData.web_version_url,
61
})
62
63
export default connect(mapStateToProps)(CV)
64