Skip to content

Commit 230b817

Browse files
authored
Merge pull request #84 from daithihearn/styling
Styling
2 parents 360f6aa + c7e936a commit 230b817

File tree

11 files changed

+65
-39
lines changed

11 files changed

+65
-39
lines changed

public/cards/originals/blank_card.png

-7.59 KB
Loading
10.9 KB
Loading
-5.09 KB
Loading
5.85 KB
Loading

src/components/StartNewGame/StartNewGame.tsx

Lines changed: 11 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,21 +102,8 @@ const StartNewGame = () => {
102102
<CardHeader tag="h2">Start a new game</CardHeader>
103103
<CardBody>
104104
<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-
117105
<Form onSubmit={startGame}>
118106
<FormGroup>
119-
<Label for="exampleText">Name</Label>
120107
<Input
121108
className="name"
122109
id="newGameName"
@@ -125,7 +112,6 @@ const StartNewGame = () => {
125112
autoComplete="off"
126113
onChange={handleNameChange}
127114
value={newGameName}
128-
disabled={selectedPlayers.length < 2}
129115
required
130116
/>
131117
</FormGroup>
@@ -143,6 +129,17 @@ const StartNewGame = () => {
143129
</Button>
144130
</ButtonGroup>
145131
</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+
/>
146143
</FormGroup>
147144
</CardBody>
148145
</Card>
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
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

src/pages/Game/Game.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { useSnackbar } from "notistack"
1313
import { getHasGame, resetGame } from "../../caches/GameSlice"
1414
import { clearAutoPlay } from "../../caches/AutoPlaySlice"
1515
import { clearMyCards } from "../../caches/MyCardsSlice"
16-
import Loading from "../../components/icons/Loading"
16+
import RefreshingData from "../../components/icons/RefreshingData"
1717

1818
const Game = () => {
1919
const dispatch = useAppDispatch()
@@ -44,7 +44,9 @@ const Game = () => {
4444
}, [id])
4545

4646
return (
47-
<PullToRefresh onRefresh={fetchData} refreshingContent={<Loading />}>
47+
<PullToRefresh
48+
onRefresh={fetchData}
49+
refreshingContent={<RefreshingData />}>
4850
<div className="app carpet">
4951
<div className="game_wrap">
5052
<div className="game_container">

src/pages/Game/_game.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
.card {
66
--cui-card-bg: ;
7+
border: 0;
78
}
89

910
.cardNotSelected {

src/pages/Home/Home.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,8 @@ import { getMyProfile } from "../../caches/MyProfileSlice"
1313
import GameService from "../../services/GameService"
1414
import { useSnackbar } from "notistack"
1515
import StatsService from "../../services/StatsService"
16-
import Loading from "../../components/icons/Loading"
1716
import { Divider } from "@mui/material"
17+
import RefreshingData from "../../components/icons/RefreshingData"
1818

1919
const Home = () => {
2020
const dispatch = useAppDispatch()
@@ -39,7 +39,9 @@ const Home = () => {
3939
}, [])
4040

4141
return (
42-
<PullToRefresh onRefresh={fetchData} refreshingContent={<Loading />}>
42+
<PullToRefresh
43+
onRefresh={fetchData}
44+
refreshingContent={<RefreshingData />}>
4345
<div className="app carpet">
4446
<div className="game_wrap">
4547
<div className="game_container">

src/pages/Layout/Layout.tsx

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,26 +15,24 @@ const Layout = () => {
1515
}, [isLoading, isAuthenticated])
1616

1717
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>
3836
</div>
3937
)
4038
}

0 commit comments

Comments
 (0)