Skip to content

Commit 8a193f9

Browse files
committed
Remove primer
1 parent 317d868 commit 8a193f9

File tree

7 files changed

+3537
-5602
lines changed

7 files changed

+3537
-5602
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,4 @@
33
/.cache
44
/pullapprove-browser-extension.zip
55
.DS_Store
6+
.parcel-cache

components/group.jsx

Lines changed: 71 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,94 @@
11
import React from "react";
2-
import { Flex, Box, Text, StyledOcticon, Avatar } from "@primer/components";
3-
import { CheckIcon, DotFillIcon, XIcon } from "@primer/octicons-react";
42

5-
const SuccessIcon = (props) => (
6-
<StyledOcticon icon={CheckIcon} color="state.success" size={props.size} />
3+
const SuccessIcon = () => (
4+
<span style={{ color: "green", fontSize: "1.5em" }}>
5+
<svg
6+
fill="currentColor"
7+
xmlns="http://www.w3.org/2000/svg"
8+
viewBox="0 0 16 16"
9+
width="16"
10+
height="16"
11+
>
12+
<path d="M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.751.751 0 0 1 .018-1.042.751.751 0 0 1 1.042-.018L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z"></path>
13+
</svg>
14+
</span>
715
);
8-
const PendingIcon = (props) => (
9-
<StyledOcticon icon={DotFillIcon} color="state.pending" size={props.size} />
16+
const PendingIcon = () => (
17+
<span style={{ color: "orange", fontSize: "1.5em" }}>
18+
<svg
19+
fill="currentColor"
20+
xmlns="http://www.w3.org/2000/svg"
21+
viewBox="0 0 16 16"
22+
width="16"
23+
height="16"
24+
>
25+
<path d="M8 4a4 4 0 1 1 0 8 4 4 0 0 1 0-8Z"></path>
26+
</svg>
27+
</span>
1028
);
11-
const RejectedIcon = (props) => (
12-
<StyledOcticon icon={XIcon} color="state.failure" size={props.size} />
29+
const RejectedIcon = () => (
30+
<span style={{ color: "red", fontSize: "1.5em" }}>
31+
<svg
32+
fill="currentColor"
33+
xmlns="http://www.w3.org/2000/svg"
34+
viewBox="0 0 16 16"
35+
width="16"
36+
height="16"
37+
>
38+
<path d="M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.749.749 0 0 1 1.275.326.749.749 0 0 1-.215.734L9.06 8l3.22 3.22a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215L8 9.06l-3.22 3.22a.751.751 0 0 1-1.042-.018.751.751 0 0 1-.018-1.042L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z"></path>
39+
</svg>
40+
</span>
1341
);
1442

1543
const User = (props) => (
16-
<Flex alignContent="center" justifyContent="space-between" mt={2}>
17-
<Flex alignContent="center">
18-
<Avatar
44+
<div
45+
style={{
46+
display: "flex",
47+
alignItems: "center",
48+
justifyContent: "space-between",
49+
marginTop: "8px",
50+
}}
51+
>
52+
<div style={{ display: "flex", alignItems: "center" }}>
53+
<img
1954
src={`${window.location.origin}/${props.username}.png`}
20-
size={20}
55+
alt={props.username}
56+
style={{ width: "20px", height: "20px", borderRadius: "50%" }}
2157
/>
22-
<Text
23-
ml={1}
24-
fontWeight={props.username === props.currentUsername ? "bold" : ""}
58+
<span
59+
style={{
60+
marginLeft: "4px",
61+
fontWeight:
62+
props.username === props.currentUsername ? "bold" : "normal",
63+
}}
2564
>
2665
{props.username}
27-
</Text>
28-
</Flex>
66+
</span>
67+
</div>
2968
{props.icon}
30-
</Flex>
69+
</div>
3170
);
3271

3372
export default class Group extends React.Component {
3473
render() {
3574
const { name, data, currentUsername } = this.props;
3675
return (
37-
<Box mb="3">
38-
<Flex alignContent="center" justifyContent="space-between">
39-
<code className="text-bold">{name}</code>
40-
<div>
41-
<Text mr={1}>
76+
<div style={{ marginBottom: "24px" }}>
77+
<div
78+
style={{
79+
display: "flex",
80+
justifyContent: "space-between",
81+
alignItems: "center",
82+
}}
83+
>
84+
<code style={{ fontWeight: "bold" }}>{name}</code>
85+
<div style={{ display: "flex", alignItems: "center" }}>
86+
<span style={{ marginRight: "8px" }}>
4287
{data.score}/{data.required}
43-
</Text>
88+
</span>
4489
{data.is_passing ? <SuccessIcon /> : <PendingIcon />}
4590
</div>
46-
</Flex>
91+
</div>
4792
{data.users_approved.map((username) => (
4893
<User
4994
key={username}
@@ -68,7 +113,7 @@ export default class Group extends React.Component {
68113
icon={<RejectedIcon />}
69114
/>
70115
))}
71-
</Box>
116+
</div>
72117
);
73118
}
74119
}

components/sidebar-report.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from "react";
2-
import { BaseStyles, Flex } from "@primer/components";
32
import Status from "./status";
43
import Group from "./group";
54
import { getURLParameterByName } from "./utils";
@@ -62,12 +61,15 @@ export default class SidebarReport extends React.Component {
6261
}
6362

6463
return (
65-
<BaseStyles>
64+
<div>
6665
<div className="discussion-sidebar-item">
67-
<Flex
68-
alignItems="center"
69-
justifyContent="space-between"
66+
<div
7067
className="discussion-sidebar-heading"
68+
style={{
69+
display: "flex",
70+
alignItems: "center",
71+
justifyContent: "space-between",
72+
}}
7173
>
7274
<div className="text-bold">
7375
{name === "pullapprove" ? "PullApprove" : name}
@@ -77,13 +79,13 @@ export default class SidebarReport extends React.Component {
7779
View report
7880
</a>
7981
) : null}
80-
</Flex>
82+
</div>
8183
{statusNode}
8284
{groupNodes.length > 0 ? groupNodes : null}
8385
</div>
8486
{/* Dumb visual hack to get the divider styling as if it were next to the other sidebar items */}
8587
<div className="discussion-sidebar-item"></div>
86-
</BaseStyles>
88+
</div>
8789
);
8890
}
8991
}

components/sidebar.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,8 @@ export default class Sidebar extends React.Component {
4646
);
4747
const reports = {};
4848
links.forEach((link) => {
49-
const statusName = link.parentNode.previousElementSibling.children[0].innerText.trim();
49+
const statusName =
50+
link.parentNode.previousElementSibling.children[0].innerText.trim();
5051
if (
5152
statusName.toLowerCase().indexOf("pullapprove") !== -1 &&
5253
getURLParameterByName(link.href, "url") !== null

0 commit comments

Comments
 (0)