modules/home/components/experiences/Experience.js
last analyzed

Complexity

Total Complexity 0
Complexity/F 0

Size

Lines of Code 75
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Test Coverage

Coverage 85.71%

Importance

Changes 0
Metric Value
wmc 0
eloc 60
mnd 0
bc 0
fnc 0
dl 0
loc 75
ccs 6
cts 7
cp 0.8571
bpm 0
cpm 0
noi 0
c 0
b 0
f 0
1
import React from 'react'
2
import styled from 'styled-components/macro'
3
import PropTypes from 'prop-types'
4
import Item from '~/modules/home/components/experiences/Item'
5
import { VerticalTimelineElement } from 'react-vertical-timeline-component'
6
import { Translate } from 'react-localize-redux'
7
import { useTheme } from '~/modules/core/theme/ThemeProviderSelector'
8
9 4
const useStyles = theme => ({
10
  content: {
11
    borderTop: `4px solid  ${theme.colors.colorAccent}`,
12
    background: theme.colors.colorLight,
13
    paddingLeft: 25
14
  },
15
  arrow: {
16
    borderRight: `10px solid  ${theme.colors.colorLight}`
17
  },
18
  icon: {
19
    background: theme.colors.ghostWhite,
20
    color: 'black',
21
    alignItems: 'center',
22
    display: 'flex',
23
    justifyContent: 'center',
24
    overflow: 'hidden',
25
    boxShadow: `0 0 0 3px ${theme.colors.colorAccent}, inset 0 2px 0 rgba(0,0,0,.08), 0 3px 0 4px rgba(0,0,0,.05)`
26
  }
27
})
28
29 1
const Experience = ({ company, icon }) => {
30 4
  const theme = useTheme({})
31 4
  const classes = useStyles(theme)
32 4
  return (
33
    <VerticalTimelineElement
34
      className="vertical-timeline-element--work"
35
      contentStyle={classes.content}
36
      contentArrowStyle={classes.arrow}
37
      icon={<Logo src={icon} alt={company} />}
38
      iconStyle={classes.icon}
39
      date={
40
        <Dates>
41
          <Translate id={`Exp: ${company} Dates`} />
42
        </Dates>
43
      }
44
    >
45
      <Container>
46
        <Item
47
          title={`Exp: ${company} Title`}
48
          role={`Exp: ${company} Role`}
49
          dates={`Exp: ${company} Dates`}
50
          description={`Exp: ${company} Desc`}
51
          descriptionExtra={`Exp: ${company} Extra`}
52
          skill={`Exp: ${company} Skill`}
53
        />
54
      </Container>
55
    </VerticalTimelineElement>
56
  )
57
}
58
59 1
Experience.propTypes = {
60
  company: PropTypes.string,
61
  icon: PropTypes.string
62
}
63
64
export default Experience
65
66
const Container = styled.div``
67
68
const Logo = styled.img`
69
  width: 100%;
70
`
71
const Dates = styled.span`
72
  color: ${props => props.theme.colors.colorBlack};
73
  font-weight: 700;
74
`
75