File tree Expand file tree Collapse file tree 11 files changed +65
-39
lines changed Expand file tree Collapse file tree 11 files changed +65
-39
lines changed Original file line number Diff line number Diff line change @@ -102,21 +102,8 @@ const StartNewGame = () => {
102
102
< CardHeader tag = "h2" > Start a new game</ CardHeader >
103
103
< CardBody >
104
104
< FormGroup >
105
- < DataTable
106
- noHeader
107
- pagination
108
- theme = "solarized"
109
- data = { allPlayers }
110
- columns = { columns }
111
- highlightOnHover
112
- selectableRows
113
- customStyles = { customStyles }
114
- onSelectedRowsChange = { togglePlayer }
115
- />
116
-
117
105
< Form onSubmit = { startGame } >
118
106
< FormGroup >
119
- < Label for = "exampleText" > Name</ Label >
120
107
< Input
121
108
className = "name"
122
109
id = "newGameName"
@@ -125,7 +112,6 @@ const StartNewGame = () => {
125
112
autoComplete = "off"
126
113
onChange = { handleNameChange }
127
114
value = { newGameName }
128
- disabled = { selectedPlayers . length < 2 }
129
115
required
130
116
/>
131
117
</ FormGroup >
@@ -143,6 +129,17 @@ const StartNewGame = () => {
143
129
</ Button >
144
130
</ ButtonGroup >
145
131
</ Form >
132
+ < DataTable
133
+ noHeader
134
+ pagination
135
+ theme = "solarized"
136
+ data = { allPlayers }
137
+ columns = { columns }
138
+ highlightOnHover
139
+ selectableRows
140
+ customStyles = { customStyles }
141
+ onSelectedRowsChange = { togglePlayer }
142
+ />
146
143
</ FormGroup >
147
144
</ CardBody >
148
145
</ Card >
Original file line number Diff line number Diff line change
1
+ import LoadingIcon from "../../assets/img/brand/loading.gif"
2
+
3
+ const RefreshingData = ( ) => {
4
+ return (
5
+ < >
6
+ < img
7
+ src = { LoadingIcon }
8
+ className = "refreshing-data"
9
+ alt = "Refreshing data"
10
+ />
11
+ </ >
12
+ )
13
+ }
14
+ export default RefreshingData
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ import { useSnackbar } from "notistack"
13
13
import { getHasGame , resetGame } from "../../caches/GameSlice"
14
14
import { clearAutoPlay } from "../../caches/AutoPlaySlice"
15
15
import { clearMyCards } from "../../caches/MyCardsSlice"
16
- import Loading from "../../components/icons/Loading "
16
+ import RefreshingData from "../../components/icons/RefreshingData "
17
17
18
18
const Game = ( ) => {
19
19
const dispatch = useAppDispatch ( )
@@ -44,7 +44,9 @@ const Game = () => {
44
44
} , [ id ] )
45
45
46
46
return (
47
- < PullToRefresh onRefresh = { fetchData } refreshingContent = { < Loading /> } >
47
+ < PullToRefresh
48
+ onRefresh = { fetchData }
49
+ refreshingContent = { < RefreshingData /> } >
48
50
< div className = "app carpet" >
49
51
< div className = "game_wrap" >
50
52
< div className = "game_container" >
Original file line number Diff line number Diff line change 4
4
5
5
.card {
6
6
--cui-card-bg : ;
7
+ border : 0 ;
7
8
}
8
9
9
10
.cardNotSelected {
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ import { getMyProfile } from "../../caches/MyProfileSlice"
13
13
import GameService from "../../services/GameService"
14
14
import { useSnackbar } from "notistack"
15
15
import StatsService from "../../services/StatsService"
16
- import Loading from "../../components/icons/Loading"
17
16
import { Divider } from "@mui/material"
17
+ import RefreshingData from "../../components/icons/RefreshingData"
18
18
19
19
const Home = ( ) => {
20
20
const dispatch = useAppDispatch ( )
@@ -39,7 +39,9 @@ const Home = () => {
39
39
} , [ ] )
40
40
41
41
return (
42
- < PullToRefresh onRefresh = { fetchData } refreshingContent = { < Loading /> } >
42
+ < PullToRefresh
43
+ onRefresh = { fetchData }
44
+ refreshingContent = { < RefreshingData /> } >
43
45
< div className = "app carpet" >
44
46
< div className = "game_wrap" >
45
47
< div className = "game_container" >
Original file line number Diff line number Diff line change @@ -15,26 +15,24 @@ const Layout = () => {
15
15
} , [ isLoading , isAuthenticated ] )
16
16
17
17
return (
18
- < div >
19
- < div className = "main_content" >
20
- < span className = "app" style = { { overflowX : "hidden" } } >
21
- < div className = "app_body" >
22
- < main className = "main" >
23
- { isAuthenticated && accessToken ? (
24
- < >
25
- < DefaultHeader />
26
- < Outlet />
27
- </ >
28
- ) : (
29
- < >
30
- < DefaultHeader />
31
- < Loading />
32
- </ >
33
- ) }
34
- </ main >
35
- </ div >
36
- </ span >
37
- </ div >
18
+ < div className = "main_content" >
19
+ < span className = "app" style = { { overflowX : "hidden" } } >
20
+ < div className = "app_body" >
21
+ < main className = "main" >
22
+ { isAuthenticated && accessToken ? (
23
+ < >
24
+ < DefaultHeader />
25
+ < Outlet />
26
+ </ >
27
+ ) : (
28
+ < >
29
+ < DefaultHeader />
30
+ < Loading />
31
+ </ >
32
+ ) }
33
+ </ main >
34
+ </ div >
35
+ </ span >
38
36
</ div >
39
37
)
40
38
}
You can’t perform that action at this time.
0 commit comments