File tree Expand file tree Collapse file tree 2 files changed +33
-9
lines changed
src/components/UserDetails/Badges Expand file tree Collapse file tree 2 files changed +33
-9
lines changed Original file line number Diff line number Diff line change @@ -14,13 +14,37 @@ const Badge = ({badge}: any) => {
14
14
)
15
15
16
16
return (
17
- < >
18
- < h4 > { data . displayName } </ h4 >
19
- < Hexagon size = { 60 } color = "red" >
20
- < BadgeIcon displayName = { data . displayName } />
21
- </ Hexagon >
22
- { data . currentLevel }
23
- </ >
17
+ < div className = "flex items-center " >
18
+ < Hexagon size = { 60 } color = "red" >
19
+ < BadgeIcon displayName = { data . displayName } />
20
+ </ Hexagon >
21
+ < div className = " ml-8" >
22
+ < span className = "font-bold block" > Level: { data . currentLevel } </ span >
23
+ < span className = "text-sm block" > 524 lines to next level</ span >
24
+ < div className = "progress-bar" >
25
+ < style jsx >
26
+ { `
27
+ .progress-bar {
28
+ position: relative;
29
+ height: 10px;
30
+ width: 120px;
31
+ background-color: #ccc;
32
+ border-radius: 5px;
33
+ box-shadow: inset 0.3em 0.3em 1em rgba(0,0,0,0.3);
34
+ }
35
+ .progress-bar:after {
36
+ content: '';
37
+ position: absolute;
38
+ width: ${ 1.2 * data . progressPercentageToNextLevel } px;
39
+ height: inherit;
40
+ background-color: red;
41
+ border-radius: 5px;
42
+ }
43
+ ` }
44
+ </ style >
45
+ </ div >
46
+ </ div >
47
+ </ div >
24
48
)
25
49
}
26
50
Original file line number Diff line number Diff line change @@ -29,13 +29,13 @@ const BadgeList = ({user}: any) => {
29
29
}
30
30
31
31
return (
32
- < >
32
+ < div className = "space-y-4" >
33
33
{
34
34
data . badges . edges . map ( ( badge ) => ( < Badge key = { badge . node . id } badge = { badge . node } /> ) )
35
35
}
36
36
{ hasNext ? < button onClick = { ( ) => { loadNext ( 2 ) } } > Load more</ button > : null }
37
37
38
- </ >
38
+ </ div >
39
39
)
40
40
}
41
41
You can’t perform that action at this time.
0 commit comments