11import 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
1543const 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
3372export 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}
0 commit comments