diff --git a/src/components/ActiveFilters.tsx b/src/components/ActiveFilters.tsx
index 0c2720f..032dc68 100644
--- a/src/components/ActiveFilters.tsx
+++ b/src/components/ActiveFilters.tsx
@@ -1,7 +1,8 @@
import React from 'react'
import { useHookstate } from '@hookstate/core'
import { gameDashboardState } from '../stateManagement/gameState'
-import { Flex, Stack, HStack, Link, Spacer, Tag, TagCloseButton, TagLabel } from '@chakra-ui/react'
+import { Flex, Stack, HStack, Link, Spacer } from '@chakra-ui/react'
+import {Tag} from './ui/tag'
import getWithFilters from '../componentUtils/getWithFilters'
import {
loadingState,
@@ -53,7 +54,7 @@ const ActiveFilters = () => {
}} direction={{
base: 'column',
md: 'row'
- }} spacing={4}>
+ }} gap={4}>
{searchParams.length >= 1 && (
<>
Search:
@@ -61,11 +62,8 @@ const ActiveFilters = () => {
size={'md'}
borderRadius="full"
variant="solid"
- colorScheme="blue"
- >
- setSearchModalOpen.set(true)}>{searchParams}
- {
+ colorPalette="blue"
+ onClose={async () => {
const newSearchParams = ""
ChangeActiveFilterHeader(filters, newSearchParams, setShowFiltersModuleState)
searchComplete.set(false)
@@ -80,7 +78,9 @@ const ActiveFilters = () => {
useRatingState,
useSteamRatingState,
)
- }} />
+ }}
+ > setSearchModalOpen.set(true)}>{searchParams}
>
)}
@@ -99,22 +99,20 @@ const ActiveFilters = () => {
<>
{filter}
-
+
{filters[filter as keyof typeof filters].split(',').map((item: string, index) => (
- {
+ colorPalette="blue"
+ onClose={() => removeFilters(filter, item)}
+ >{
item.includes('lte')
? item.replace('lte', '<= ')
: item.includes('gte') ? item.replace('gte', '>= ')
: item}
-
- removeFilters(filter, item)} />
))}
diff --git a/src/components/FilterBar.tsx b/src/components/FilterBar.tsx
index ea36a8f..ccc794d 100644
--- a/src/components/FilterBar.tsx
+++ b/src/components/FilterBar.tsx
@@ -1,17 +1,12 @@
import React, {MutableRefObject, useEffect} from 'react'
import {
Center,
- Divider,
- Drawer,
- DrawerBody,
- DrawerCloseButton,
- DrawerContent,
- DrawerFooter,
- DrawerHeader,
- DrawerOverlay, Flex,
+ Separator,
+ Flex,
Heading, Spacer,
Text,
} from '@chakra-ui/react'
+import {DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerHeader, DrawerRoot} from './ui/drawer'
import AdminMode from './authComponents/AdminMode'
import {StateMethods, useHookstate} from '@hookstate/core'
import {tagState} from '../stateManagement/tagState'
@@ -25,7 +20,7 @@ import {
} from '../componentUtils/SelectValues'
import {retrieveTags} from '../componentUtils/retrieveTags'
import {gameDashboardState} from '../stateManagement/gameState'
-import {Select} from 'chakra-react-select'
+import {Select} from './FixedSelect'
import getWithFilters from '../componentUtils/getWithFilters'
import {loadingState, showFiltersModuleState} from '../stateManagement/loadingState'
import {adminMode} from '../stateManagement/userState'
@@ -99,26 +94,25 @@ function FilterBar({filterIsOpen, filterOnClose, btnRef}: Props) {
}
return (
- { if (!e.open) filterOnClose() }}
+ finalFocusEl={() => btnRef.current as unknown as HTMLElement}
>
-
-
+
Filters
-
+
-
+
Series
-
+
)
}
-export default FilterBar
\ No newline at end of file
+export default FilterBar
diff --git a/src/components/Footer.tsx b/src/components/Footer.tsx
index 2091fc0..fce4181 100644
--- a/src/components/Footer.tsx
+++ b/src/components/Footer.tsx
@@ -6,7 +6,7 @@ export default function Footer() {
return (
-
+
diff --git a/src/components/GamesDashboard.tsx b/src/components/GamesDashboard.tsx
index 280b6f8..24539ba 100644
--- a/src/components/GamesDashboard.tsx
+++ b/src/components/GamesDashboard.tsx
@@ -4,7 +4,7 @@ import React, { useEffect } from 'react'
import { gameDashboardState } from '../stateManagement/gameState'
import { loadingState } from '../stateManagement/loadingState'
import { useHookstate } from '@hookstate/core'
-import { Box, Center, Container, Divider, Heading, SimpleGrid, VStack } from '@chakra-ui/react'
+import { Box, Center, Container, Separator, Heading, SimpleGrid, VStack } from '@chakra-ui/react'
import Pagination from './Pagination'
import { NavLink } from 'react-router-dom'
import { adminMode } from '../stateManagement/userState'
@@ -33,34 +33,36 @@ const GameDashboard = () => {
return (
<>
-
+
-
+
{!loaded ? : games.count.totalGames === 0 ?
-
+
No Results Found...
-
+
{games.searchParams !== '' ?
-
+
:
+ >
+
Create a Game
+
}
:
-
+
{games.data.map((game) => (
{
game={game} />
))}
}
-
+
>
diff --git a/src/components/Header.tsx b/src/components/Header.tsx
index bc99a00..43c2b64 100644
--- a/src/components/Header.tsx
+++ b/src/components/Header.tsx
@@ -9,27 +9,23 @@ import {
Link,
HStack,
Stack,
- useColorModeValue,
Menu,
- MenuButton,
- Avatar,
- MenuList,
- MenuItem,
- MenuDivider,
+ Portal,
Icon,
- useColorMode,
Text,
Center,
VStack,
- Tooltip,
- Divider,
+ Separator,
Heading,
Kbd,
Spacer,
useDisclosure,
useMediaQuery,
} from '@chakra-ui/react'
-import { AddIcon, HamburgerIcon, Search2Icon, SettingsIcon } from '@chakra-ui/icons'
+import {useColorMode, useColorModeValue} from './ui/color-mode'
+import {Tooltip} from './ui/tooltip'
+import {Avatar} from './ui/avatar'
+import { LuPlus, LuMenu, LuSearch, LuSettings } from 'react-icons/lu'
import SearchModal from './SearchModal'
import { openAndCloseSearchDialogue } from '../stateManagement/loadingState'
import AdminMode from './authComponents/AdminMode'
@@ -49,10 +45,10 @@ export default function NavBar() {
const bgLink = useColorModeValue('gray.200', 'gray.700')
const location = useLocation()
const history = useNavigate()
- const { isOpen: mobileIsOpen, onOpen: mobileOnOpen, onClose: mobileOnClose } = useDisclosure()
- const { isOpen: filterIsOpen, onOpen: filterOnOpen, onClose: filterOnClose } = useDisclosure()
+ const { open: mobileIsOpen, onOpen: mobileOnOpen, onClose: mobileOnClose } = useDisclosure()
+ const { open: filterIsOpen, onOpen: filterOnOpen, onClose: filterOnClose } = useDisclosure()
const btnRef = React.useRef(null)
- const [isSmallerThan768] = useMediaQuery('(max-width: 768px)')
+ const [isSmallerThan768] = useMediaQuery(['(max-width: 768px)'])
const handleKeyPress = useCallback((event: any) => {
if (event.ctrlKey === true && event.key === ',') {
@@ -95,13 +91,13 @@ export default function NavBar() {
position={loadedPreferences.get().stickyNav ? "fixed" : "relative"}
justifyContent={'space-between'}
>
-
-
- Game Database
+
+
+ Game Database
- Games
+ asChild>
+ Games
- Create Game
+ asChild>
+ Create Game
@@ -135,7 +129,7 @@ export default function NavBar() {
{isSmallerThan768 ?
<>
@@ -144,7 +138,7 @@ export default function NavBar() {
{ user.role === 'admin' && }
-
+
+
+
+
+
+
+
+ Create Game
+
+
+ Keyboard Shortcuts
+ Search:ctrl + ,
+ Games Grid:ctrl + .
+ Create
+ Game:ctrl + /
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {user.displayName}
+
+
+
+ history('/profile')}>Preferences
+ logout()}> Logout
+
+
+
+
}
diff --git a/src/components/Home.tsx b/src/components/Home.tsx
index 2400aae..161f02f 100644
--- a/src/components/Home.tsx
+++ b/src/components/Home.tsx
@@ -4,13 +4,13 @@ import { VStack, Image, Button, Heading, Flex, Center } from '@chakra-ui/react'
const Home = () => {
return (
-
+
-
+
Welcome to your Games Database
-
- Login
+
+ Login
diff --git a/src/components/LoadingModal.tsx b/src/components/LoadingModal.tsx
index 5303349..9afe522 100644
--- a/src/components/LoadingModal.tsx
+++ b/src/components/LoadingModal.tsx
@@ -1,5 +1,5 @@
import React from 'react'
-import { Center, CircularProgress } from '@chakra-ui/react'
+import { Center, ProgressCircle } from '@chakra-ui/react'
export default function LoadingModal() {
@@ -14,7 +14,12 @@ export default function LoadingModal() {
bottom={'0'}
left={'0'}
>
-
+
+
+
+
+
+
>
)
diff --git a/src/components/MobileBar.tsx b/src/components/MobileBar.tsx
index 246a897..dbcf620 100644
--- a/src/components/MobileBar.tsx
+++ b/src/components/MobileBar.tsx
@@ -1,19 +1,18 @@
import React, { MutableRefObject } from 'react'
import {
- Avatar, Button, Center, ColorMode,
- Divider, Drawer,
- DrawerBody,
- DrawerCloseButton,
- DrawerContent, DrawerFooter,
- DrawerHeader,
- DrawerOverlay, Icon,
+ Button, Center,
+ Separator,
+ Drawer,
+ Icon,
Image, Link,
Stack, Text,
} from '@chakra-ui/react'
+import {DrawerBody, DrawerCloseTrigger, DrawerContent, DrawerFooter, DrawerHeader, DrawerRoot} from './ui/drawer'
+import {Avatar} from './ui/avatar'
import AdminMode from './authComponents/AdminMode'
import { NavLink } from 'react-router-dom'
import Search from './Search'
-import { AddIcon } from '@chakra-ui/icons'
+import { LuPlus } from 'react-icons/lu'
import { logout } from '../stateManagement/userState'
import User from '../models/user'
import { AiOutlineLogout } from 'react-icons/ai'
@@ -21,12 +20,13 @@ import {useHookstate} from "@hookstate/core";
import {searchCompletedState} from "../stateManagement/loadingState";
import {gameDashboardState} from "../stateManagement/gameState";
import ResetFilterButton from "./helperComponents/ResetFilterButton";
+import type { ColorMode } from './ui/color-mode'
interface Props {
mobileIsOpen: boolean
mobileOnClose: () => void
btnRef: MutableRefObject
- bgLink: "gray.200" | "gray.700"
+ bgLink: string
user: User
colorMode: ColorMode
toggleColorMode: () => void
@@ -37,15 +37,14 @@ function MobileBar({ mobileIsOpen, mobileOnClose, btnRef, bgLink, user }: Props)
const gamesState = useHookstate(gameDashboardState)
const games = gamesState.get()
return (
- { if (!e.open) mobileOnClose() }}
+ finalFocusEl={() => btnRef.current as unknown as HTMLElement}
>
-
-
+
@@ -54,7 +53,7 @@ function MobileBar({ mobileIsOpen, mobileOnClose, btnRef, bgLink, user }: Props)
- Games
+ asChild>
+ Games
- Create Game
+ asChild>
+ Create Game
-
+
{searchCompleted.get() && Games Found: {games.count.totalGames}}
-
- {user.displayName}
+
+ {user.displayName}
- Preferences
+ asChild>
+ Preferences
-
- {/**/}
- {/* {colorMode === 'light' ? : }*/}
- {/* {colorMode === 'light' ?*/}
- {/* Dark :*/}
- {/* Light}*/}
- {/**/}
- {/**/}
+
@@ -114,21 +103,20 @@ function MobileBar({ mobileIsOpen, mobileOnClose, btnRef, bgLink, user }: Props)
}
- as={NavLink}
+ asChild
mr={3}
- to="/games/create">
- Create Game
+ >
+ Create Game
logout()}> Logout
-
+
)
}
-export default MobileBar
\ No newline at end of file
+export default MobileBar
diff --git a/src/components/NoGames.tsx b/src/components/NoGames.tsx
index 1ee327d..3d83049 100644
--- a/src/components/NoGames.tsx
+++ b/src/components/NoGames.tsx
@@ -4,12 +4,12 @@ import { Center, Flex, Heading, Button, VStack } from '@chakra-ui/react'
export default function NoGames() {
return (
-
+
-
+
{You have not added any games yet.}
-
- Click here to add some!
+
+ Click here to add some!
diff --git a/src/components/Pagination.tsx b/src/components/Pagination.tsx
index 40f8a56..a87928e 100644
--- a/src/components/Pagination.tsx
+++ b/src/components/Pagination.tsx
@@ -4,24 +4,21 @@ import {
Grid,
GridItem,
IconButton,
- NumberDecrementStepper,
- NumberIncrementStepper,
- NumberInput,
- NumberInputField,
- NumberInputStepper,
- Select,
Text,
- Tooltip,
- useColorModeValue,
- useMediaQuery,
+ Portal,
} from '@chakra-ui/react'
-import { ArrowLeftIcon, ArrowRightIcon, ChevronLeftIcon, ChevronRightIcon } from '@chakra-ui/icons'
+import {NumberInputRoot, NumberInputField} from './ui/number-input'
+import { NativeSelect } from '@chakra-ui/react'
+import { LuChevronLeft, LuChevronRight, LuChevronsLeft, LuChevronsRight } from 'react-icons/lu'
+import {Tooltip} from './ui/tooltip'
import { useHookstate } from '@hookstate/core'
import { gameDashboardState } from '../stateManagement/gameState'
import { loadingState } from '../stateManagement/loadingState'
import { adminMode } from '../stateManagement/userState'
import getWithFilters from '../componentUtils/getWithFilters'
import { ratingState, steamRatingState } from "../stateManagement/ratingState";
+import {useColorModeValue} from "./ui/color-mode";
+import {useMediaQuery} from "@chakra-ui/react";
export default function Pagination() {
const gamesState = useHookstate(gameDashboardState)
@@ -34,7 +31,7 @@ export default function Pagination() {
const bg = useColorModeValue('gray.50', 'transparent')
const useRatingState = useHookstate(ratingState).get()
const useSteamRatingState = useHookstate(steamRatingState).get()
- const [isSmallerThan768] = useMediaQuery('(max-width: 768px)')
+ const [isSmallerThan768] = useMediaQuery(['(max-width: 768px)'])
const setPageSize = async (limit: number) => await getWithFilters(
gamesState,
@@ -99,22 +96,24 @@ export default function Pagination() {
}}>
-
+
gotoPage(0)}
- isDisabled={pageIndex <= 1}
- icon={}
+ disabled={pageIndex <= 1}
mr={4}
- />
+ >
+
+
-
+
}
- />
+ disabled={pageIndex <= 1}
+ >
+
+
@@ -133,70 +132,79 @@ export default function Pagination() {
{!isSmallerThan768 &&
Go to Page:
- {
- const page = value ? Number(value) : 1
+ value={String(pageIndex)}
+ onValueChange={(e) => {
+ const page = e.value ? Number(e.value) : 1
gotoPage(page)
}}
>
-
-
-
-
-
-
+
+
}
Count Per Page:
- {
- setPageSize(Number(e.target.value))
- }}
>
- {[10, 20, 30, 40, 50].map((pageSize) => (
-
- ))}
-
+ {
+ setPageSize(Number(e.target.value))
+ }}
+ >
+ {[10, 20, 30, 40, 50].map((pageSize) => (
+
+ ))}
+
+
+
Games Found: {games.count.totalGames}
-
+
= pageCount}
- icon={}
- />
+ disabled={pageIndex >= pageCount}
+ >
+
+
-
+
gotoPage(pageCount)}
- isDisabled={pageIndex >= pageCount}
- icon={}
+ disabled={pageIndex >= pageCount}
ml={4}
- />
+ >
+
+
diff --git a/src/components/Search.tsx b/src/components/Search.tsx
index e6ce6dd..d051828 100644
--- a/src/components/Search.tsx
+++ b/src/components/Search.tsx
@@ -1,6 +1,7 @@
import React, { FormEvent } from 'react'
-import { Button, FormControl, Input, InputGroup, InputRightElement, useColorModeValue } from '@chakra-ui/react'
-import { SearchIcon } from '@chakra-ui/icons'
+import { Button, Input, Group } from '@chakra-ui/react'
+import { Field } from './ui/field'
+import { LuSearch } from 'react-icons/lu'
import { GameList } from '../models/game'
import { useHookstate } from '@hookstate/core'
import { gameDashboardState } from '../stateManagement/gameState'
@@ -14,6 +15,7 @@ import { adminMode } from '../stateManagement/userState'
import getWithFilters from '../componentUtils/getWithFilters'
import {ChangeActiveFilterHeader} from "../componentUtils/changeActiveFilterHeader";
import {ratingState, steamRatingState} from "../stateManagement/ratingState";
+import {useColorModeValue} from "./ui/color-mode";
export default function Search() {
const gamesState = useHookstate(gameDashboardState)
@@ -54,16 +56,16 @@ export default function Search() {
return (
<>
>
)
-}
\ No newline at end of file
+}
diff --git a/src/components/SearchModal.tsx b/src/components/SearchModal.tsx
index c124d13..4d9eb11 100644
--- a/src/components/SearchModal.tsx
+++ b/src/components/SearchModal.tsx
@@ -1,8 +1,6 @@
import React from 'react'
-import {
- Modal, ModalBody, ModalCloseButton, ModalContent,
- ModalHeader,
-} from '@chakra-ui/react'
+import { Dialog } from '@chakra-ui/react'
+import {DialogBody, DialogCloseTrigger, DialogContent, DialogHeader, DialogRoot} from './ui/dialog'
import { useHookstate } from '@hookstate/core'
import { openAndCloseSearchDialogue } from '../stateManagement/loadingState'
import Search from './Search'
@@ -16,14 +14,14 @@ export default function SearchModal() {
}
return (
-
-
- Search
- handleClose()}/>
-
+ { if (!e.open) handleClose() }}>
+
+ Search
+ handleClose()}/>
+
-
-
-
+
+
+
)
}
diff --git a/src/components/dashboardComponents/DashboardLoadingModal.tsx b/src/components/dashboardComponents/DashboardLoadingModal.tsx
index e8e35a3..9f774c4 100644
--- a/src/components/dashboardComponents/DashboardLoadingModal.tsx
+++ b/src/components/dashboardComponents/DashboardLoadingModal.tsx
@@ -1,5 +1,5 @@
import React from 'react'
-import { Center, CircularProgress } from '@chakra-ui/react'
+import { Center, ProgressCircle } from '@chakra-ui/react'
export default function DashboardLoadingModal() {
@@ -9,7 +9,12 @@ export default function DashboardLoadingModal() {
w="100%"
mt={'1rem'}
>
-
+
+
+
+
+
+
>
)
diff --git a/src/components/helperComponents/ResetFilterButton.tsx b/src/components/helperComponents/ResetFilterButton.tsx
index f1bcd2c..7fd1151 100644
--- a/src/components/helperComponents/ResetFilterButton.tsx
+++ b/src/components/helperComponents/ResetFilterButton.tsx
@@ -9,12 +9,12 @@ import { ratingState, steamRatingState } from "../../stateManagement/ratingState
interface Props {
text?: string
- size?: string
- variant?: string
- colorScheme?: string
+ size?: "2xs" | "xs" | "sm" | "md" | "lg" | "xl" | "2xl"
+ variant?: "solid" | "subtle" | "surface" | "outline" | "ghost" | "plain"
+ colorPalette?: string
}
-const ResetFilterButton = ({ text = "Reset Search and Filters", size = 'md', variant = 'solid', colorScheme = 'gray' }: Props) => {
+const ResetFilterButton = ({ text = "Reset Search and Filters", size = 'md', variant = 'solid', colorPalette = 'gray' }: Props) => {
const gameState = useHookstate(gameDashboardState)
const games = gameState.get()
const admin = useHookstate(adminMode).get()
@@ -58,7 +58,7 @@ const ResetFilterButton = ({ text = "Reset Search and Filters", size = 'md', var
}
return (
-
+
{text}
)
diff --git a/src/components/helperComponents/SteamAndDeckLogo.tsx b/src/components/helperComponents/SteamAndDeckLogo.tsx
index 602216d..7dc11ad 100644
--- a/src/components/helperComponents/SteamAndDeckLogo.tsx
+++ b/src/components/helperComponents/SteamAndDeckLogo.tsx
@@ -9,17 +9,19 @@ const SteamAndDeckLogo = (props: ISteamAndDeckLogo) => {
return (
);