Total Complexity | 0 |
Complexity/F | 0 |
Lines of Code | 34 |
Function Count | 0 |
Duplicated Lines | 0 |
Ratio | 0 % |
Coverage | 33.33% |
Changes | 0 |
1 | import React from 'react' |
||
2 | import PropTypes from 'prop-types' |
||
3 | import styled from 'styled-components/macro' |
||
4 | |||
5 | 1 | const SelectedImage = ({ index, photo, margin, onClick }) => ( |
|
6 | <div style={{ margin, height: photo.height, width: photo.width }}> |
||
7 | <Image alt={photo.title} {...photo} onClick={() => onClick(index)} /> |
||
8 | </div> |
||
9 | ) |
||
10 | |||
11 | 1 | SelectedImage.propTypes = { |
|
12 | index: PropTypes.number, |
||
13 | photo: PropTypes.shape({ |
||
14 | title: PropTypes.string, |
||
15 | height: PropTypes.number, |
||
16 | width: PropTypes.number |
||
17 | }), |
||
18 | margin: PropTypes.string, |
||
19 | onClick: PropTypes.func |
||
20 | } |
||
21 | |||
22 | export default SelectedImage |
||
23 | |||
24 | const Image = styled.img` |
||
25 | border: 0.5px solid ${props => props.theme.colors.colorDarken}; |
||
26 | |||
27 | &:hover { |
||
28 | transition: transform 0.135s cubic-bezier(0, 0, 0.2, 1), |
||
29 | opacity linear 0.15s; |
||
30 | opacity: 0.6; |
||
31 | border: 3px solid ${props => props.theme.colors.colorAccent}; |
||
32 | } |
||
33 | ` |
||
34 |