Passed
Push — task/comments-api ( c7d753...19d8e5 )
by Yonathan
32:15 queued 19:33
created

resources/assets/js/components/UnclaimedJobCard.tsx   A

Complexity

Total Complexity 3
Complexity/F 0

Size

Lines of Code 127
Function Count 0

Duplication

Duplicated Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
wmc 3
eloc 105
dl 0
loc 127
rs 10
c 0
b 0
f 0
mnd 3
bc 3
fnc 0
bpm 0
cpm 0
noi 1
1
import React from "react";
2
import { FormattedMessage } from "react-intl";
3
import { JobStatus } from "../models/lookupConstants";
4
5
export interface UnclaimedJobCardProps {
6
  title: string;
7
  createdAt: string;
8
  status: JobStatus;
9
  hiringManagers: string[];
10
  hrAdvisors: string[];
11
}
12
13
const UnclaimedJobCard: React.FunctionComponent<UnclaimedJobCardProps> = ({
14
  title,
15
  createdAt,
16
  status,
17
  hiringManagers,
18
  hrAdvisors,
19
}) => {
20
  return (
21
    <div
22
      data-c-grid-item="tp(1of2) tl(1of3) equal-col"
23
      className="tc-hr-job-card"
24
    >
25
      <div data-c-card data-c-radius="rounded" data-c-background="white(100)">
26
        <a href="" title="" style={{ textDecoration: "none" }}>
0 ignored issues
show
introduced by
The href attribute requires a valid value to be accessible. Provide a valid, navigable address as the href value. If you cannot provide a valid href, but still need the element to resemble a link, use a button and change it with appropriate styles. Learn more: https://github.com/evcohen/eslint-plugin-jsx-a11y/blob/master/docs/rules/anchor-is-valid.md
Loading history...
27
          <div data-c-background="black(100)" data-c-padding="all(normal)">
28
            <div data-c-grid="gutter middle">
29
              <div data-c-grid-item="base(1of1)">
30
                <p
31
                  data-c-font-size="h4"
32
                  data-c-colour="white"
33
                  data-c-font-style="underline"
34
                >
35
                  {title}
36
                </p>
37
              </div>
38
              <div data-c-grid-item="base(1of2)">
39
                <p data-c-colour="white" data-c-font-size="small">
40
                  <FormattedMessage
41
                    id="openJobCard.createdAt"
42
                    description="Header for when Job Poster was created."
43
                    defaultMessage="Created: "
44
                  />
45
                  {createdAt}
46
                </p>
47
              </div>
48
              <div data-c-grid-item="base(1of2)" data-c-align="base(right)">
49
                <span
50
                  data-c-color="white"
51
                  data-c-border="all(thin, solid, white)"
52
                  data-c-padding="tb(quarter) rl(half)"
53
                  data-c-font-size="small"
54
                  data-c-radius="pill"
55
                >
56
                  {status}
57
                </span>
58
              </div>
59
            </div>
60
          </div>
61
          <div data-c-padding="all(normal)">
62
            <p data-c-color="black" data-c-margin="bottom(normal)">
63
              <FormattedMessage
64
                id="openJobCard.hiringManager"
65
                description="Header before list of hiring managers."
66
                defaultMessage="Hiring Managers: "
67
              />
68
69
              {hiringManagers.map((manager, index): string => {
70
                const comma =
71
                  hiringManagers.length !== 1 &&
72
                  index + 1 !== hiringManagers.length
73
                    ? ","
74
                    : " ";
75
                return `${manager}${comma} `;
76
              })}
77
            </p>
78
79
            {hrAdvisors.length > 0 ? (
80
              <p data-c-color="black" data-c-margin="bottom(normal)">
81
                <FormattedMessage
82
                  id="openJobCard.hrAdvisors"
83
                  description="Header before list of HR advisors."
84
                  defaultMessage="HR Advisors: "
85
                />
86
                {hrAdvisors.map((advisor, index): string => {
87
                  const comma =
88
                    hrAdvisors.length !== 1 && index + 1 !== hrAdvisors.length
89
                      ? ","
90
                      : " ";
91
                  return `${advisor}${comma} `;
92
                })}
93
              </p>
94
            ) : (
95
              <p data-c-color="stop">
96
                <FormattedMessage
97
                  id="openJobCard.unclaimed"
98
                  description="Message displayed if not HR managers have claimed a job."
99
                  defaultMessage="Unclaimed"
100
                />
101
              </p>
102
            )}
103
          </div>
104
          <div
105
            data-c-padding="all(normal)"
106
            data-c-border="top(thin, solid, black)"
107
            data-c-align="base(right)"
108
          >
109
            <span data-c-color="black">
110
              +{" "}
111
              <span data-c-font-style="underline">
112
                <FormattedMessage
113
                  id="openJobCard.claimJob"
114
                  description="Message indicating the event of clicking on the job card."
115
                  defaultMessage="Claim This Job"
116
                />
117
              </span>
118
            </span>
119
          </div>
120
        </a>
121
      </div>
122
    </div>
123
  );
124
};
125
126
export default UnclaimedJobCard;
127