Skip to content

Commit

Permalink
#97 - Adds icons
Browse files Browse the repository at this point in the history
  • Loading branch information
plaszczkowski committed Jul 30, 2020
1 parent d0a4bf3 commit b14ba62
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 3 deletions.
23 changes: 20 additions & 3 deletions src/containers/detailsPage/data-row.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,21 @@ import React from 'react';
import PropTypes from 'prop-types';
import { isArray } from 'lodash';

function IconYes() {
return (
<svg xmlns="http://www.w3.org/2000/svg" className="table-icon" viewBox="0 0 3.93 2.86">
<use href="#tick" fill="#323335" />
</svg>
);
}
function IconNo() {
return (
<svg xmlns="http://www.w3.org/2000/svg" className="table-icon" viewBox="0 0 3.06 3.06">
<use href="#cross" fill="#323335" />
</svg>
);
}

export function DataRow({ row }) {
const {
data,
Expand All @@ -17,15 +32,17 @@ export function DataRow({ row }) {
if (data === 'yes') {
value = url ? (
<span>
yes | Go to
{IconYes()}
{' '}
| Go to
{' '}
<a className="link-gray" href={url} target="_blank" rel="noopener noreferrer">
{label}
</a>
</span>
) : 'yes';
) : IconYes();
} else {
value = 'no';
value = IconNo();
}
} else if (url) {
value = (
Expand Down
6 changes: 6 additions & 0 deletions src/containers/detailsPage/details-page.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,12 @@ export default function DetailsPage() {
))
}
</div>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3.06 3.06" style={{ display: 'none' }}>
<polygon id="cross" points="3.06 0.46 2.6 0 1.53 1.07 0.46 0 0 0.46 1.07 1.53 0 2.6 0.46 3.06 1.53 1.99 2.6 3.06 3.06 2.6 1.99 1.53 3.06 0.46" />
</svg>
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 3.93 2.86" style={{ display: 'none' }}>
<polygon id="tick" points="1.53 2.86 0 1.33 0.46 0.87 1.53 1.94 3.47 0 3.93 0.46 1.53 2.86" />
</svg>
</Container>
);
}
5 changes: 5 additions & 0 deletions src/containers/detailsPage/styled-container.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -114,5 +114,10 @@ const StyledContainer = styled.div`
}
}
}
.table-icon {
width: 9px;
opacity: 0.87;
}
}
`;

0 comments on commit b14ba62

Please sign in to comment.