xonecas.io
366
Hc

hirenimble-challenge / commit 553e514

remove calls to styled from inside the render functions

xonecas2020-09-01 553e5145bd492b1526ce1c02181c7cce621308a5 parent 47c5c01

2 files changed

src/components/candidateListItem.js+5−5
@@ -9,6 +9,11 @@ import NimbleScore from "ui-kit/icons/svg/nimble_score.svg";
99 import Scorecard from "ui-kit/icons/svg/scorecard.svg";
1010 import Notes from "ui-kit/icons/svg/note.svg";
1111
12+const TableCell = styled.td`
13+ padding: 1em 0;
14+ border-bottom: 1px solid #ccc;
15+`;
16+
1217 function CandidateListItem(props) {
1318 const candidate = props.candidate;
1419 const [visibility, setVisibility] = useState(false);
@@ -17,11 +22,6 @@ function CandidateListItem(props) {
1722 setVisibility(!visibility);
1823 };
1924
20- const TableCell = styled.td`
21- padding: 1em 0;
22- border-bottom: 1px solid #ccc;
23- `;
24-
2525 return (
2626 <React.Fragment key={candidate.id}>
2727 <tr onClick={toggleApplicationDetail}>
src/components/candidatesList.js+19−19
@@ -3,27 +3,27 @@ import styled from "styled-components";
33
44 import CandidateListItem from "./candidateListItem";
55
6-function CandidatesList(props) {
7- const candidates = props.candidates.results;
6+const Table = styled.table`
7+ padding: 2em;
8+ border-spacing: 0;
9+ width: 100%;
10+`;
811
9- const Table = styled.table`
10- padding: 2em;
11- border-spacing: 0;
12- width: 100%;
13- `;
12+const TableHeader = styled.th`
13+ border-bottom: 1px solid #ccc;
14+ color: #999;
15+ font-size: 0.6em;
16+ font-weight: 500;
17+ max-width: 20em;
18+ overflow: hidden;
19+ padding-bottom: 0.5em;
20+ text-align: left;
21+ text-overflow: ellipsis;
22+ text-transform: uppercase;
23+`;
1424
15- const TableHeader = styled.th`
16- border-bottom: 1px solid #ccc;
17- color: #999;
18- font-size: 0.6em;
19- font-weight: 500;
20- max-width: 20em;
21- overflow: hidden;
22- padding-bottom: 0.5em;
23- text-align: left;
24- text-overflow: ellipsis;
25- text-transform: uppercase;
26- `;
25+function CandidatesList(props) {
26+ const candidates = props.candidates.results;
2727
2828 return (
2929 <Table cellspacing="0" cellpadding="0">