File tree 6 files changed +79
-86
lines changed
__tests__/app/containers/__snapshots__
6 files changed +79
-86
lines changed Original file line number Diff line number Diff line change @@ -29,70 +29,58 @@ exports[`SideBar Container Should render 1`] = `
29
29
<div
30
30
className = " w-100 justify-content-center align-items-center btn-group-vertical"
31
31
>
32
- <Button
33
- active = { false }
34
- block = { false }
35
- bsClass = " btn"
36
- bsStyle = " default"
32
+ <a
37
33
className = " py-2 px-auto text-white d-flex justify-content-center"
38
- disabled = { false }
39
- onClick = { [Function ]}
34
+ href = " /#/home"
40
35
>
41
- <button
42
- className = " py-2 px-auto text-white d-flex justify-content-center btn btn-default"
43
- disabled = { false }
44
- onClick = { [Function ]}
45
- type = " button"
46
- >
47
- <FontAwesomeIcon
48
- border = { false }
49
- className = " "
50
- fixedWidth = { false }
51
- flip = { null }
52
- icon = {
53
- Object {
54
- " icon" : Array [
55
- 640 ,
56
- 512 ,
57
- Array [],
58
- " f121" ,
59
- " M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z" ,
60
- ],
61
- " iconName" : " code" ,
62
- " prefix" : " fas" ,
63
- }
36
+ <FontAwesomeIcon
37
+ border = { false }
38
+ className = " "
39
+ fixedWidth = { false }
40
+ flip = { null }
41
+ icon = {
42
+ Object {
43
+ " icon" : Array [
44
+ 576 ,
45
+ 512 ,
46
+ Array [],
47
+ " f015" ,
48
+ " M488 312.7V456c0 13.3-10.7 24-24 24H348c-6.6 0-12-5.4-12-12V356c0-6.6-5.4-12-12-12h-72c-6.6 0-12 5.4-12 12v112c0 6.6-5.4 12-12 12H112c-13.3 0-24-10.7-24-24V312.7c0-3.6 1.6-7 4.4-9.3l188-154.8c4.4-3.6 10.8-3.6 15.3 0l188 154.8c2.7 2.3 4.3 5.7 4.3 9.3zm83.6-60.9L488 182.9V44.4c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12V117l-89.5-73.7c-17.7-14.6-43.3-14.6-61 0L4.4 251.8c-5.1 4.2-5.8 11.8-1.6 16.9l25.5 31c4.2 5.1 11.8 5.8 16.9 1.6l235.2-193.7c4.4-3.6 10.8-3.6 15.3 0l235.2 193.7c5.1 4.2 12.7 3.5 16.9-1.6l25.5-31c4.2-5.2 3.4-12.7-1.7-16.9z" ,
49
+ ],
50
+ " iconName" : " home" ,
51
+ " prefix" : " fas" ,
64
52
}
65
- inverse = { false }
66
- listItem = { false }
67
- mask = { null }
68
- pull = { null }
69
- pulse = { false }
70
- rotation = { null }
71
- size = { null }
72
- spin = { false }
73
- symbol = { false }
74
- title = " "
75
- transform = { null }
53
+ }
54
+ inverse = { false }
55
+ listItem = { false }
56
+ mask = { null }
57
+ pull = { null }
58
+ pulse = { false }
59
+ rotation = { null }
60
+ size = { null }
61
+ spin = { false }
62
+ symbol = { false }
63
+ title = " "
64
+ transform = { null }
65
+ >
66
+ <svg
67
+ aria-hidden = " true"
68
+ className = " svg-inline--fa fa-home fa-w-18 "
69
+ data-icon = " home"
70
+ data-prefix = " fas"
71
+ role = " img"
72
+ style = { Object {}}
73
+ viewBox = " 0 0 576 512"
74
+ xmlns = " http://www.w3.org/2000/svg"
76
75
>
77
- <svg
78
- aria-hidden = " true"
79
- className = " svg-inline--fa fa-code fa-w-20 "
80
- data-icon = " code"
81
- data-prefix = " fas"
82
- role = " img"
76
+ <path
77
+ d = " M488 312.7V456c0 13.3-10.7 24-24 24H348c-6.6 0-12-5.4-12-12V356c0-6.6-5.4-12-12-12h-72c-6.6 0-12 5.4-12 12v112c0 6.6-5.4 12-12 12H112c-13.3 0-24-10.7-24-24V312.7c0-3.6 1.6-7 4.4-9.3l188-154.8c4.4-3.6 10.8-3.6 15.3 0l188 154.8c2.7 2.3 4.3 5.7 4.3 9.3zm83.6-60.9L488 182.9V44.4c0-6.6-5.4-12-12-12h-56c-6.6 0-12 5.4-12 12V117l-89.5-73.7c-17.7-14.6-43.3-14.6-61 0L4.4 251.8c-5.1 4.2-5.8 11.8-1.6 16.9l25.5 31c4.2 5.1 11.8 5.8 16.9 1.6l235.2-193.7c4.4-3.6 10.8-3.6 15.3 0l235.2 193.7c5.1 4.2 12.7 3.5 16.9-1.6l25.5-31c4.2-5.2 3.4-12.7-1.7-16.9z"
78
+ fill = " currentColor"
83
79
style = { Object {}}
84
- viewBox = " 0 0 640 512"
85
- xmlns = " http://www.w3.org/2000/svg"
86
- >
87
- <path
88
- d = " M278.9 511.5l-61-17.7c-6.4-1.8-10-8.5-8.2-14.9L346.2 8.7c1.8-6.4 8.5-10 14.9-8.2l61 17.7c6.4 1.8 10 8.5 8.2 14.9L293.8 503.3c-1.9 6.4-8.5 10.1-14.9 8.2zm-114-112.2l43.5-46.4c4.6-4.9 4.3-12.7-.8-17.2L117 256l90.6-79.7c5.1-4.5 5.5-12.3.8-17.2l-43.5-46.4c-4.5-4.8-12.1-5.1-17-.5L3.8 247.2c-5.1 4.7-5.1 12.8 0 17.5l144.1 135.1c4.9 4.6 12.5 4.4 17-.5zm327.2.6l144.1-135.1c5.1-4.7 5.1-12.8 0-17.5L492.1 112.1c-4.8-4.5-12.4-4.3-17 .5L431.6 159c-4.6 4.9-4.3 12.7.8 17.2L523 256l-90.6 79.7c-5.1 4.5-5.5 12.3-.8 17.2l43.5 46.4c4.5 4.9 12.1 5.1 17 .6z"
89
- fill = " currentColor"
90
- style = { Object {}}
91
- />
92
- </svg >
93
- </FontAwesomeIcon >
94
- </button >
95
- </Button >
80
+ />
81
+ </svg >
82
+ </FontAwesomeIcon >
83
+ </a >
96
84
<Button
97
85
active = { false }
98
86
block = { false }
Original file line number Diff line number Diff line change @@ -84,19 +84,11 @@ export class Leaderboard extends React.Component<
84
84
isLoggedIn,
85
85
} = this . props ;
86
86
return (
87
- < Grid fluid = { true } className = { classnames ( styles . Leaderboard ) } >
88
- { isLoggedIn ? < SocketHandler /> : null }
89
- < Row className = { classnames ( 'py-2 pl-3' , styles . leaderboardTitle ) } >
90
- < Col
91
- sm = { 9 }
92
- className = "text-light font-weight-bold my-auto"
93
- style = { { left : '45%' , height : '10%' , paddingTop : '10px' , paddingBottom : '10px' } }
94
- >
95
- LEADERBOARD
96
- </ Col >
97
- </ Row >
98
- { this . state . isSearching ? (
99
- < Row className = { classnames ( 'py-2 pl-3' , styles . leaderboardTitle ) } >
87
+ < >
88
+ < NavBar isLoggedIn = { isLoggedIn } page = { NavPage . LEADERBOARD } />
89
+ < Grid fluid = { true } className = { classnames ( styles . Leaderboard ) } >
90
+ { isLoggedIn ? < SocketHandler /> : null }
91
+ < Row className = { classnames ( 'py-4 pl-3' ) } >
100
92
< Col
101
93
sm = { 10 }
102
94
className = "text-light font-weight-bold my-auto"
Original file line number Diff line number Diff line change @@ -37,15 +37,17 @@ export class Sidebar extends React.Component<SideBarInterfaces.Props, {}> {
37
37
vertical
38
38
className = { classnames ( 'w-100 justify-content-center align-items-center' , styles . Sidebar ) }
39
39
>
40
- < Button
40
+ < a
41
+ href = "/#/home"
41
42
className = { classnames (
42
43
'py-2 px-auto text-white d-flex justify-content-center' ,
43
44
styles . customBtn ,
44
45
) }
45
46
onClick = { ( ) => closeSidePanelTab ( ) }
46
47
>
47
- < FontAwesomeIcon icon = { faCode } />
48
- </ Button >
48
+ < FontAwesomeIcon icon = { faHome } />
49
+ </ a >
50
+
49
51
< Button
50
52
className = { classnames ( 'py-2 px-auto documentation-btn-ctrl' , styles . customBtn , {
51
53
[ `${ styles . customBtnActive } ` ] : sidePanelTab === SidePanelTab . DOCS ,
Original file line number Diff line number Diff line change @@ -17,7 +17,8 @@ initializeRendererAssets();
17
17
18
18
/* tslint:disable-next-line:variable-name */
19
19
export const App = hot ( module ) ( ( ) => (
20
- < BrowserRouter >
20
+ < HashRouter >
21
+ < Sugar background = "#484848" color = "white" />
21
22
< Switch >
22
23
< Route exact path = { Routes . ROOT } component = { Dashboard } />
23
24
< Route exact path = { Routes . LOGIN } component = { Login } />
@@ -26,6 +27,5 @@ export const App = hot(module)(() => (
26
27
< Route exact path = { Routes . USER_PROFILE_MODEL } component = { UserProfileModal } />
27
28
< Route path = { Routes . USER_ACTIVATION } component = { ActivateUser } />
28
29
</ Switch >
29
- < Sugar background = "#484848" color = "white" />
30
- </ BrowserRouter >
30
+ </ HashRouter >
31
31
) ) ;
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ export function* getMatches(action: ActionType<typeof MatchActions.getMatches>)
18
18
19
19
if ( isArray ( res ) ) {
20
20
const matchData = mapMatchResponse ( res ) ;
21
-
22
21
yield put ( MatchActions . updateMatches ( matchData ) ) ;
23
22
} else yield put ( NotificationActions . error ( res . message ) ) ;
24
23
} catch ( err ) {
Original file line number Diff line number Diff line change @@ -60,15 +60,27 @@ export const mapMatchResponse = (
60
60
} ) ;
61
61
} ;
62
62
63
+ export enum VERDICT {
64
+ TIE = 'TIE' ,
65
+ PLAYER1 = 'PLAYER1' ,
66
+ PLAYER2 = 'PLAYER2' ,
67
+ }
68
+
69
+ export enum MAP_VERDICT_TO_STRING {
70
+ TIE = '0' ,
71
+ PLAYER1 = '1' ,
72
+ PLAYER2 = '2' ,
73
+ }
74
+
63
75
const getVerdict = ( verdict : string ) => {
64
76
switch ( verdict ) {
65
- case 'PLAYER_1' :
66
- return '1' ;
67
- case 'PLAYER_1' :
68
- return '2' ;
69
- case ' TIE' :
70
- return '0' ;
77
+ case VERDICT . PLAYER1 :
78
+ return MAP_VERDICT_TO_STRING . PLAYER1 ;
79
+ case VERDICT . PLAYER2 :
80
+ return MAP_VERDICT_TO_STRING . PLAYER2 ;
81
+ case VERDICT . TIE :
82
+ return MAP_VERDICT_TO_STRING . TIE ;
71
83
default :
72
- return '0' ;
84
+ return MAP_VERDICT_TO_STRING . TIE ;
73
85
}
74
86
} ;
You can’t perform that action at this time.
0 commit comments