Total Complexity | 1 |
Complexity/F | 0 |
Lines of Code | 46 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 100% |
Changes | 0 |
1 | import React from 'react' |
||
2 | import styled from 'styled-components/macro' |
||
3 | import Info from '~/modules/home/components/certification/Info' |
||
4 | import Title from '~/modules/home/components/certification/Title' |
||
5 | import { LEFT_INFO_POS } from '~/modules/home/consts/certification' |
||
6 | import PropTypes from 'prop-types' |
||
7 | import { Translate } from 'react-localize-redux' |
||
8 | import Col from 'react-bootstrap/Col' |
||
9 | |||
10 | 1 | const CertInfo = ({ itemSelected, id, title, content }) => { |
|
11 | 4 | return ( |
|
12 | <ShowOnSelectedCol sm={12} xs={12} itemselected={itemSelected} id={id}> |
||
13 | <ListInfo id={id}> |
||
14 | <Title> |
||
15 | <span>{id}</span> — <Translate id={title} /> |
||
16 | </Title> |
||
17 | <p> |
||
18 | <Translate id={content} /> |
||
19 | </p> |
||
20 | </ListInfo> |
||
21 | </ShowOnSelectedCol> |
||
22 | ) |
||
23 | } |
||
24 | |||
25 | export default CertInfo |
||
26 | |||
27 | 1 | CertInfo.propTypes = { |
|
28 | itemSelected: PropTypes.number, |
||
29 | id: PropTypes.number, |
||
30 | title: PropTypes.string, |
||
31 | content: PropTypes.string |
||
32 | } |
||
33 | |||
34 | const ListInfo = styled(Info)` |
||
35 | position: relative; |
||
36 | |||
37 | &::before, |
||
38 | &::after { |
||
39 | 4 | left: ${({ id }) => LEFT_INFO_POS[id - 1]}; |
|
40 | } |
||
41 | ` |
||
42 | |||
43 | const ShowOnSelectedCol = styled(Col)` |
||
44 | 4 | display: ${({ itemselected, id }) => (itemselected == id ? 'block' : 'none')}; |
|
45 | ` |
||
46 |