Skip to content

Commit

Permalink
Merge pull request #84 from daithihearn/styling
Browse files Browse the repository at this point in the history
Styling
  • Loading branch information
daithihearn authored Jan 15, 2023
2 parents 360f6aa + c7e936a commit 230b817
Show file tree
Hide file tree
Showing 11 changed files with 65 additions and 39 deletions.
Binary file modified public/cards/originals/blank_card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cards/originals/blank_card_outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified public/cards/thumbnails/blank_card.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/cards/thumbnails/blank_card_outline.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 11 additions & 14 deletions src/components/StartNewGame/StartNewGame.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,21 +102,8 @@ const StartNewGame = () => {
<CardHeader tag="h2">Start a new game</CardHeader>
<CardBody>
<FormGroup>
<DataTable
noHeader
pagination
theme="solarized"
data={allPlayers}
columns={columns}
highlightOnHover
selectableRows
customStyles={customStyles}
onSelectedRowsChange={togglePlayer}
/>

<Form onSubmit={startGame}>
<FormGroup>
<Label for="exampleText">Name</Label>
<Input
className="name"
id="newGameName"
Expand All @@ -125,7 +112,6 @@ const StartNewGame = () => {
autoComplete="off"
onChange={handleNameChange}
value={newGameName}
disabled={selectedPlayers.length < 2}
required
/>
</FormGroup>
Expand All @@ -143,6 +129,17 @@ const StartNewGame = () => {
</Button>
</ButtonGroup>
</Form>
<DataTable
noHeader
pagination
theme="solarized"
data={allPlayers}
columns={columns}
highlightOnHover
selectableRows
customStyles={customStyles}
onSelectedRowsChange={togglePlayer}
/>
</FormGroup>
</CardBody>
</Card>
Expand Down
14 changes: 14 additions & 0 deletions src/components/icons/RefreshingData.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import LoadingIcon from "../../assets/img/brand/loading.gif"

const RefreshingData = () => {
return (
<>
<img
src={LoadingIcon}
className="refreshing-data"
alt="Refreshing data"
/>
</>
)
}
export default RefreshingData
6 changes: 4 additions & 2 deletions src/pages/Game/Game.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { useSnackbar } from "notistack"
import { getHasGame, resetGame } from "../../caches/GameSlice"
import { clearAutoPlay } from "../../caches/AutoPlaySlice"
import { clearMyCards } from "../../caches/MyCardsSlice"
import Loading from "../../components/icons/Loading"
import RefreshingData from "../../components/icons/RefreshingData"

const Game = () => {
const dispatch = useAppDispatch()
Expand Down Expand Up @@ -44,7 +44,9 @@ const Game = () => {
}, [id])

return (
<PullToRefresh onRefresh={fetchData} refreshingContent={<Loading />}>
<PullToRefresh
onRefresh={fetchData}
refreshingContent={<RefreshingData />}>
<div className="app carpet">
<div className="game_wrap">
<div className="game_container">
Expand Down
1 change: 1 addition & 0 deletions src/pages/Game/_game.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

.card {
--cui-card-bg: ;
border: 0;
}

.cardNotSelected {
Expand Down
6 changes: 4 additions & 2 deletions src/pages/Home/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@ import { getMyProfile } from "../../caches/MyProfileSlice"
import GameService from "../../services/GameService"
import { useSnackbar } from "notistack"
import StatsService from "../../services/StatsService"
import Loading from "../../components/icons/Loading"
import { Divider } from "@mui/material"
import RefreshingData from "../../components/icons/RefreshingData"

const Home = () => {
const dispatch = useAppDispatch()
Expand All @@ -39,7 +39,9 @@ const Home = () => {
}, [])

return (
<PullToRefresh onRefresh={fetchData} refreshingContent={<Loading />}>
<PullToRefresh
onRefresh={fetchData}
refreshingContent={<RefreshingData />}>
<div className="app carpet">
<div className="game_wrap">
<div className="game_container">
Expand Down
38 changes: 18 additions & 20 deletions src/pages/Layout/Layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,26 +15,24 @@ const Layout = () => {
}, [isLoading, isAuthenticated])

return (
<div>
<div className="main_content">
<span className="app" style={{ overflowX: "hidden" }}>
<div className="app_body">
<main className="main">
{isAuthenticated && accessToken ? (
<>
<DefaultHeader />
<Outlet />
</>
) : (
<>
<DefaultHeader />
<Loading />
</>
)}
</main>
</div>
</span>
</div>
<div className="main_content">
<span className="app" style={{ overflowX: "hidden" }}>
<div className="app_body">
<main className="main">
{isAuthenticated && accessToken ? (
<>
<DefaultHeader />
<Outlet />
</>
) : (
<>
<DefaultHeader />
<Loading />
</>
)}
</main>
</div>
</span>
</div>
)
}
Expand Down
14 changes: 13 additions & 1 deletion src/scss/_custom.scss
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ body {

// Here you can add other styles
.main_content {
background-image: url("/assets/img/cloth.jpg");
background:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' height='100%25' width='100%25'%3E%3Cdefs%3E%3Cpattern id='doodad' width='40' height='40' viewBox='0 0 40 40' patternUnits='userSpaceOnUse' patternTransform='rotate(135)'%3E%3Crect width='100%25' height='100%25' fill='rgba(47, 133, 90,1)'/%3E%3Ccircle cx='40' cy='20' r='1' fill='%231a202c'/%3E%3Ccircle cx='0' cy='20' r='1' fill='%231a202c'/%3E%3Ccircle cx='20' cy='40' r='1' fill='%231a202c'/%3E%3Ccircle cx='20' cy='0' r='1' fill='%231a202c'/%3E%3Ccircle cx='38' cy='2' r='1' fill='%23ecc94b'/%3E%3Ccircle cx='2' cy='38' r='1' fill='%23ecc94b'/%3E%3Ccircle cx='38' cy='38' r='1' fill='%23ecc94b'/%3E%3Ccircle cx='2' cy='2' r='1' fill='%23ecc94b'/%3E%3C/pattern%3E%3C/defs%3E%3Crect fill='url(%23doodad)' height='200%25' width='200%25'/%3E%3C/svg%3E ");
background-color: #2f855a;
min-height: 800px;
position: fixed;
width: 100%;
height: 100vh;
overflow: overlay;
padding-bottom: 100px;

&_mainBody {
width: 100%;
Expand Down Expand Up @@ -64,3 +66,13 @@ body {
height: 100px;
width: 100px;
}

.refreshing-data {
position: fixed;
top: 125px;
left: 50%;
margin-top: -50px;
margin-left: -50px;
height: 100px;
width: 100px;
}

0 comments on commit 230b817

Please sign in to comment.