Rename Games page to Library & remove sidebar always show games setting
This commit is contained in:
5 files changed
+10
-41
No files matched your search
@@ -86,8 +86,6 @@ export default function RootLayout ({
|
|||||||
const [versions, setVersions] = useState<Store | null>(null)
|
const [versions, setVersions] = useState<Store | null>(null)
|
||||||
const [account, setAccount] = useState<Store | null>(null)
|
const [account, setAccount] = useState<Store | null>(null)
|
||||||
|
|
||||||
const [sidebarAlwaysShowGames, setSidebarAlwaysShowGames] =
|
|
||||||
useState<boolean>(false)
|
|
||||||
const [linuxUseWine, setLinuxUseWine] = useState<boolean>(false)
|
const [linuxUseWine, setLinuxUseWine] = useState<boolean>(false)
|
||||||
const [linuxWineCommand, setLinuxWineCommand] =
|
const [linuxWineCommand, setLinuxWineCommand] =
|
||||||
useState<string>('wine %path%')
|
useState<string>('wine %path%')
|
||||||
@@ -357,7 +355,7 @@ export default function RootLayout ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
const closePopup = useCallback(() => {
|
const closePopup = useCallback(() => {
|
||||||
if (popupMode == 0 && selectedGame && pathname === '/main/games') {
|
if (popupMode == 0 && selectedGame && pathname === '/main/library') {
|
||||||
setSelectedGame(null)
|
setSelectedGame(null)
|
||||||
setSelectedVersionList([])
|
setSelectedVersionList([])
|
||||||
} else if (viewingInfoFromDownloads) {
|
} else if (viewingInfoFromDownloads) {
|
||||||
@@ -829,9 +827,6 @@ export default function RootLayout ({
|
|||||||
}
|
}
|
||||||
|
|
||||||
watchSettings<string>('theme', v => setTheme(v ?? 'dark'))
|
watchSettings<string>('theme', v => setTheme(v ?? 'dark'))
|
||||||
watchSettings<boolean>('sidebarAlwaysShowGames', v =>
|
|
||||||
setSidebarAlwaysShowGames(v ?? true)
|
|
||||||
)
|
|
||||||
watchSettings<boolean>('linuxUseWine', v => setLinuxUseWine(v ?? false))
|
watchSettings<boolean>('linuxUseWine', v => setLinuxUseWine(v ?? false))
|
||||||
watchSettings<string>('linuxWineCommand', v =>
|
watchSettings<string>('linuxWineCommand', v =>
|
||||||
setLinuxWineCommand(v ?? 'wine %path%')
|
setLinuxWineCommand(v ?? 'wine %path%')
|
||||||
@@ -897,7 +892,6 @@ export default function RootLayout ({
|
|||||||
settings,
|
settings,
|
||||||
versions,
|
versions,
|
||||||
account,
|
account,
|
||||||
sidebarAlwaysShowGames,
|
|
||||||
linuxUseWine,
|
linuxUseWine,
|
||||||
linuxWineCommand,
|
linuxWineCommand,
|
||||||
theme,
|
theme,
|
||||||
@@ -955,7 +949,7 @@ export default function RootLayout ({
|
|||||||
icon={
|
icon={
|
||||||
(popupMode == 0 &&
|
(popupMode == 0 &&
|
||||||
selectedGame &&
|
selectedGame &&
|
||||||
pathname === '/main/games') ||
|
pathname === '/main/library') ||
|
||||||
viewingInfoFromDownloads ||
|
viewingInfoFromDownloads ||
|
||||||
(popupMode == 3 && showModInfo) ||
|
(popupMode == 3 && showModInfo) ||
|
||||||
popupMode == 4
|
popupMode == 4
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import {
|
|||||||
import { platform } from '@tauri-apps/plugin-os'
|
import { platform } from '@tauri-apps/plugin-os'
|
||||||
import { useRouter } from 'next/navigation'
|
import { useRouter } from 'next/navigation'
|
||||||
|
|
||||||
export default function GamesPage () {
|
export default function LibraryPage () {
|
||||||
const {
|
const {
|
||||||
versionsList,
|
versionsList,
|
||||||
serverVersionList,
|
serverVersionList,
|
||||||
@@ -21,7 +21,6 @@ export default function SettingsPage () {
|
|||||||
account,
|
account,
|
||||||
version,
|
version,
|
||||||
versionsList,
|
versionsList,
|
||||||
sidebarAlwaysShowGames,
|
|
||||||
linuxUseWine,
|
linuxUseWine,
|
||||||
linuxWineCommand,
|
linuxWineCommand,
|
||||||
theme,
|
theme,
|
||||||
@@ -34,17 +33,6 @@ export default function SettingsPage () {
|
|||||||
<p className='text-3xl ml-4 mt-4'>Settings</p>
|
<p className='text-3xl ml-4 mt-4'>Settings</p>
|
||||||
<div className='flex flex-row p-4 gap-4'>
|
<div className='flex flex-row p-4 gap-4'>
|
||||||
<div className='bg-(--col1) border border-(--col3) rounded-lg p-4 w-fit h-fit'>
|
<div className='bg-(--col1) border border-(--col3) rounded-lg p-4 w-fit h-fit'>
|
||||||
<Setting
|
|
||||||
label='Always show games in sidebar'
|
|
||||||
value={sidebarAlwaysShowGames}
|
|
||||||
onChange={async () => {
|
|
||||||
await settings?.set(
|
|
||||||
'sidebarAlwaysShowGames',
|
|
||||||
!sidebarAlwaysShowGames
|
|
||||||
)
|
|
||||||
}}
|
|
||||||
title="This setting will make it so when you are on a page like this, the games won't disappear."
|
|
||||||
/>
|
|
||||||
<Setting
|
<Setting
|
||||||
label='Use wine if needed'
|
label='Use wine if needed'
|
||||||
value={linuxUseWine}
|
value={linuxUseWine}
|
||||||
|
|||||||
@@ -39,7 +39,6 @@ export default function Sidebar () {
|
|||||||
downloadProgress,
|
downloadProgress,
|
||||||
category,
|
category,
|
||||||
setCategory,
|
setCategory,
|
||||||
sidebarAlwaysShowGames,
|
|
||||||
linuxUseWine,
|
linuxUseWine,
|
||||||
setManagingGame,
|
setManagingGame,
|
||||||
settings,
|
settings,
|
||||||
@@ -108,9 +107,9 @@ export default function Sidebar () {
|
|||||||
</Link>
|
</Link>
|
||||||
<Link
|
<Link
|
||||||
draggable={false}
|
draggable={false}
|
||||||
href='/main/games'
|
href='/main/library'
|
||||||
className={`link relative flex items-center ${
|
className={`link relative flex items-center ${
|
||||||
pathname === '/main/games' || pathname.startsWith('/main/game')
|
pathname === '/main/library' || pathname.startsWith('/main/game')
|
||||||
? 'active'
|
? 'active'
|
||||||
: ''
|
: ''
|
||||||
}`}
|
}`}
|
||||||
@@ -138,9 +137,10 @@ export default function Sidebar () {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
<FontAwesomeIcon icon={faHexagonNodes} className='mr-2' /> Games
|
<FontAwesomeIcon icon={faHexagonNodes} className='mr-2' /> Library
|
||||||
</Link>
|
</Link>
|
||||||
{serverVersionList?.games
|
{(pathname === '/main/library' || pathname.startsWith('/main/game')) &&
|
||||||
|
serverVersionList?.games
|
||||||
.filter(g =>
|
.filter(g =>
|
||||||
serverVersionList.versions
|
serverVersionList.versions
|
||||||
.filter(v => v.game === g.id)
|
.filter(v => v.game === g.id)
|
||||||
@@ -155,13 +155,7 @@ export default function Sidebar () {
|
|||||||
Number(params.get('id') || 0) == i.id
|
Number(params.get('id') || 0) == i.id
|
||||||
? 'active'
|
? 'active'
|
||||||
: ''
|
: ''
|
||||||
} ml-auto w-50 ${
|
} ml-auto w-50`}
|
||||||
sidebarAlwaysShowGames ||
|
|
||||||
pathname === '/main/games' ||
|
|
||||||
pathname.startsWith('/main/game')
|
|
||||||
? ''
|
|
||||||
: 'hidden'
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCategory(-1)
|
setCategory(-1)
|
||||||
router.push('/main/game?id=' + i.id)
|
router.push('/main/game?id=' + i.id)
|
||||||
@@ -214,13 +208,7 @@ export default function Sidebar () {
|
|||||||
category == Number(key)
|
category == Number(key)
|
||||||
? 'active'
|
? 'active'
|
||||||
: ''
|
: ''
|
||||||
} ml-auto w-47.5 ${
|
} ml-auto w-47.5`}
|
||||||
sidebarAlwaysShowGames ||
|
|
||||||
pathname === '/main/games' ||
|
|
||||||
pathname.startsWith('/main/game')
|
|
||||||
? ''
|
|
||||||
: 'hidden'
|
|
||||||
}`}
|
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
setCategory(Number(key))
|
setCategory(Number(key))
|
||||||
router.push('/main/game?id=' + i.id)
|
router.push('/main/game?id=' + i.id)
|
||||||
|
|||||||
@@ -54,7 +54,6 @@ type GlobalCtxType = {
|
|||||||
settings: Store | null
|
settings: Store | null
|
||||||
versions: Store | null
|
versions: Store | null
|
||||||
account: Store | null
|
account: Store | null
|
||||||
sidebarAlwaysShowGames: boolean
|
|
||||||
linuxUseWine: boolean
|
linuxUseWine: boolean
|
||||||
linuxWineCommand: string
|
linuxWineCommand: string
|
||||||
theme: string
|
theme: string
|
||||||
|
|||||||
Reference in new issue
Block a user