Move away from using hidden

This commit is contained in:
Lncvrt committed 2026-05-07 17:12:36 -07:00
1 parent 635cbfc14c
commit b2fefd2c6b
9 files changed
+83 -62

No files matched your search

+15 -14
View File
@@ -71,6 +71,7 @@ export default function Installs () {
{game.name} Installs {game.name} Installs
</p> </p>
<div className='flex gap-2'> <div className='flex gap-2'>
{game.id == 1 && (
<button <button
className='button btntheme1' className='button btntheme1'
onClick={() => onClick={() =>
@@ -86,10 +87,11 @@ export default function Installs () {
}) })
} }
title='View the leaderboards for this game.' title='View the leaderboards for this game.'
hidden={game.id != 1}
> >
Leaderboards Leaderboards
</button> </button>
)}
{game.id == 9 && category == -1 && (
<button <button
className='button btntheme1' className='button btntheme1'
onClick={() => onClick={() =>
@@ -103,20 +105,21 @@ export default function Installs () {
}) })
} }
title='Open the GDPS Dashboard!' title='Open the GDPS Dashboard!'
hidden={game.id != 9 || category != -1}
> >
Dashboard Dashboard
</button> </button>
)}
{category != -1 && (
<button <button
className='button btntheme1' className='button btntheme1'
onClick={() => { onClick={() => {
setCategory(-1) setCategory(-1)
}} }}
title='Click to go up a level.' title='Click to go up a level.'
hidden={category == -1}
> >
Back Back
</button> </button>
)}
<button <button
className='button btntheme1' className='button btntheme1'
onClick={() => { onClick={() => {
@@ -267,27 +270,25 @@ export default function Installs () {
)} )}
</p> </p>
</div> </div>
{platform() == 'linux' &&
versionInfo.wine &&
needsRevisionUpdate(versionInfo.lastRevision, v) && (
<div <div
className='entry-info-item' className='entry-info-item'
title='This version is using wine. It cannot be guarenteed to work fully and might not work at all.' title='This version is using wine. It cannot be guarenteed to work fully and might not work at all.'
hidden={
!(platform() == 'linux' && versionInfo.wine) ||
needsRevisionUpdate(versionInfo.lastRevision, v)
}
> >
<FontAwesomeIcon icon={faWarning} color='#ffc800' /> <FontAwesomeIcon icon={faWarning} color='#ffc800' />
<p>Uses wine</p> <p>Uses wine</p>
</div> </div>
<div )}
className='entry-info-item' {needsRevisionUpdate(versionInfo.lastRevision, v) && (
hidden={ <div className='entry-info-item'>
!needsRevisionUpdate(versionInfo.lastRevision, v)
}
>
<FontAwesomeIcon icon={faWarning} color='#ffc800' /> <FontAwesomeIcon icon={faWarning} color='#ffc800' />
<p>Needs revision update!</p> <p>Needs revision update!</p>
</div> </div>
)}
</div> </div>
{versionInfo.modSupportDownload && (
<button <button
className='absolute right-0 bottom-0 button' className='absolute right-0 bottom-0 button'
title='Click to manage mods for this game!' title='Click to manage mods for this game!'
@@ -329,10 +330,10 @@ export default function Installs () {
setShowPopup(true) setShowPopup(true)
setFadeOut(false) setFadeOut(false)
}} }}
hidden={!versionInfo.modSupportDownload}
> >
Mod Manager Mod Manager
</button> </button>
)}
</div> </div>
</div> </div>
) )
+6 -8
View File
@@ -822,10 +822,9 @@ export default function RootLayout ({
<body className={theme + '-theme'}> <body className={theme + '-theme'}>
{loading ? ( {loading ? (
<> <>
<div {platformName == 'windows' && (
className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)' <div className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)' />
hidden={platformName != 'windows'} )}
/>
<div <div
className={`w-screen ${ className={`w-screen ${
platformName == 'windows' platformName == 'windows'
@@ -892,10 +891,9 @@ export default function RootLayout ({
}} }}
> >
<Sidebar /> <Sidebar />
<div {platformName == 'windows' && (
className='relative z-2 ml-59.75 w-[calc(100vw-239px)] border-b border-b-(--col3) h-8.25 bg-(--col1)' <div className='relative z-2 ml-59.75 w-[calc(100vw-239px)] border-b border-b-(--col3) h-8.25 bg-(--col1)' />
hidden={platformName != 'windows'} )}
/>
<div className='relative z-0'> <div className='relative z-0'>
<main className='ml-60'>{children}</main> <main className='ml-60'>{children}</main>
</div> </div>
+3 -2
View File
@@ -114,17 +114,17 @@ export default function Installs () {
versions installed versions installed
</p> </p>
</div> </div>
{i.official ? (
<div <div
className='entry-info-item' className='entry-info-item'
hidden={!i.official}
title='This game is official.' title='This game is official.'
> >
<FontAwesomeIcon icon={faCheck} color='#19c84b' /> <FontAwesomeIcon icon={faCheck} color='#19c84b' />
<p>Official</p> <p>Official</p>
</div> </div>
) : (
<div <div
className='entry-info-item' className='entry-info-item'
hidden={i.official}
title={ title={
i.verified i.verified
? 'This game is verified to be safe' ? 'This game is verified to be safe'
@@ -137,6 +137,7 @@ export default function Installs () {
/> />
<p>{i.verified ? 'Verified' : 'Unverified'}</p> <p>{i.verified ? 'Verified' : 'Unverified'}</p>
</div> </div>
)}
</div> </div>
</div> </div>
</div> </div>
+5 -2
View File
@@ -54,7 +54,9 @@ export default function Settings () {
}} }}
className={platform() == 'linux' ? '' : 'hidden'} className={platform() == 'linux' ? '' : 'hidden'}
/> />
<p hidden={!(platform() == 'linux' && linuxUseWine)}>Wine Command:</p> {platform() == 'linux' && linuxUseWine && (
<>
<p>Wine Command:</p>
<input <input
type='text' type='text'
value={linuxWineCommand} value={linuxWineCommand}
@@ -62,8 +64,9 @@ export default function Settings () {
await settings?.set('linuxWineCommand', e.target.value) await settings?.set('linuxWineCommand', e.target.value)
} }
className='input-field my-1' className='input-field my-1'
hidden={!(platform() == 'linux' && linuxUseWine)}
></input> ></input>
</>
)}
<Setting <Setting
label='Use custom data location' label='Use custom data location'
value={!!customDataLocation} value={!!customDataLocation}
+3 -4
View File
@@ -24,10 +24,9 @@ export default function RootLayout ({
<> <>
<html lang='en' className={roboto.className}> <html lang='en' className={roboto.className}>
<body className='dark-theme'> <body className='dark-theme'>
<div {platformName == 'windows' && (
className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)' <div className='relative z-2 w-screen border-b border-b-(--col3) h-8.25 bg-(--col1)' />
hidden={platformName != 'windows'} )}
/>
<div <div
className={`w-screen ${ className={`w-screen ${
platformName == 'windows' ? 'h-[calc(100vh-64px)]' : 'h-screen' platformName == 'windows' ? 'h-[calc(100vh-64px)]' : 'h-screen'
+5 -3
View File
@@ -51,9 +51,9 @@ export default function Sidebar () {
return ( return (
<aside className='sidebar'> <aside className='sidebar'>
{platform() == 'macos' && (
<div <div
className='macos-drag' className='macos-drag'
hidden={platform() != 'macos'}
onMouseDown={e => { onMouseDown={e => {
if (e.buttons === 1) { if (e.buttons === 1) {
if (e.detail === 2) { if (e.detail === 2) {
@@ -63,7 +63,8 @@ export default function Sidebar () {
} }
} }
}} }}
></div> />
)}
<div <div
className={ className={
'flex items-center h-10 w-60 ' + 'flex items-center h-10 w-60 ' +
@@ -228,9 +229,9 @@ export default function Sidebar () {
<FontAwesomeIcon icon={faDiscord} className='mr-1' /> Community <FontAwesomeIcon icon={faDiscord} className='mr-1' /> Community
</button> </button>
</nav> </nav>
{downloadProgress.length != 0 && (
<div <div
className='sidebar-downloads' className='sidebar-downloads'
hidden={downloadProgress.length == 0}
onClick={() => { onClick={() => {
setPopupMode(1) setPopupMode(1)
setShowPopup(true) setShowPopup(true)
@@ -241,6 +242,7 @@ export default function Sidebar () {
<FontAwesomeIcon icon={faDownload} /> Downloads <FontAwesomeIcon icon={faDownload} /> Downloads
</p> </p>
</div> </div>
)}
</aside> </aside>
) )
} }
+18 -7
View File
@@ -38,15 +38,18 @@ export default function DownloadsPopup () {
className='popup-entry flex flex-col justify-between relative' className='popup-entry flex flex-col justify-between relative'
> >
<div className='absolute right-2 top-2 flex flex-row gap-2'> <div className='absolute right-2 top-2 flex flex-row gap-2'>
{(v.downloading || v.paused) && (
<>
<div <div
className='cursor-pointer bg-(--col5) hover:bg-(--col7) border border-(--col7) hover:border-(--col9) transition-colors w-8 h-8 flex items-center justify-center rounded-full' className='cursor-pointer bg-(--col5) hover:bg-(--col7) border border-(--col7) hover:border-(--col9) transition-colors w-8 h-8 flex items-center justify-center rounded-full'
hidden={!v.downloading && !v.paused}
onClick={async () => { onClick={async () => {
if (v.downloading) { if (v.downloading) {
await invoke('cancel_download', { name: v.version }) await invoke('cancel_download', { name: v.version })
} else { } else {
setDownloadProgress(prev => { setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === v.version) const i = prev.findIndex(
d => d.version === v.version
)
if (i === -1) return prev if (i === -1) return prev
const copy = [...prev] const copy = [...prev]
copy[i] = { copy[i] = {
@@ -85,7 +88,9 @@ export default function DownloadsPopup () {
} }
} else if (res == '0') { } else if (res == '0') {
setDownloadProgress(prev => { setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === v.version) const i = prev.findIndex(
d => d.version === v.version
)
if (i === -1) return prev if (i === -1) return prev
if (prev[i].canceled) { if (prev[i].canceled) {
return prev.filter((_, idx) => idx !== i) return prev.filter((_, idx) => idx !== i)
@@ -135,12 +140,13 @@ export default function DownloadsPopup () {
</div> </div>
<div <div
className='cursor-pointer bg-(--col5) hover:bg-(--col7) border border-(--col7) hover:border-(--col9) transition-colors w-8 h-8 flex items-center justify-center rounded-full' className='cursor-pointer bg-(--col5) hover:bg-(--col7) border border-(--col7) hover:border-(--col9) transition-colors w-8 h-8 flex items-center justify-center rounded-full'
hidden={!v.downloading && !v.paused}
onClick={async () => { onClick={async () => {
if (!v.paused) { if (!v.paused) {
await invoke('cancel_download', { name: v.version }) await invoke('cancel_download', { name: v.version })
setDownloadProgress(prev => { setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === v.version) const i = prev.findIndex(
d => d.version === v.version
)
if (i === -1) return prev if (i === -1) return prev
const copy = [...prev] const copy = [...prev]
copy[i] = { copy[i] = {
@@ -151,7 +157,9 @@ export default function DownloadsPopup () {
}) })
} else { } else {
setDownloadProgress(prev => { setDownloadProgress(prev => {
const i = prev.findIndex(d => d.version === v.version) const i = prev.findIndex(
d => d.version === v.version
)
if (i === -1) return prev if (i === -1) return prev
return prev.filter((_, idx) => idx !== i) return prev.filter((_, idx) => idx !== i)
}) })
@@ -160,9 +168,11 @@ export default function DownloadsPopup () {
> >
<FontAwesomeIcon icon={faCancel} className='w-6 h-6' /> <FontAwesomeIcon icon={faCancel} className='w-6 h-6' />
</div> </div>
</>
)}
{(v.failed || v.queued) && (
<div <div
className='cursor-pointer bg-(--col5) hover:bg-(--col7) border border-(--col7) hover:border-(--col9) transition-colors w-8 h-8 flex items-center justify-center rounded-full' className='cursor-pointer bg-(--col5) hover:bg-(--col7) border border-(--col7) hover:border-(--col9) transition-colors w-8 h-8 flex items-center justify-center rounded-full'
hidden={!v.failed && !v.queued}
onClick={() => { onClick={() => {
setDownloadQueue(prev => setDownloadQueue(prev =>
prev.filter(id => id !== v.version) prev.filter(id => id !== v.version)
@@ -174,6 +184,7 @@ export default function DownloadsPopup () {
> >
<FontAwesomeIcon icon={faTrash} className='w-6 h-6' /> <FontAwesomeIcon icon={faTrash} className='w-6 h-6' />
</div> </div>
)}
</div> </div>
<p className='text-2xl text-center'> <p className='text-2xl text-center'>
{v.type == 1 {v.type == 1
+14 -12
View File
@@ -65,25 +65,27 @@ export default function ManageGamePopup () {
<> <>
<p className='text-xl text-center'>Viewing {gameInfo?.name}</p> <p className='text-xl text-center'>Viewing {gameInfo?.name}</p>
<div className='popup-content flex flex-col items-center justify-center gap-2 h-full'> <div className='popup-content flex flex-col items-center justify-center gap-2 h-full'>
<div className='entry-info-item btntheme2' hidden={!gameInfo?.official}> {gameInfo?.official ? (
<div className='entry-info-item btntheme2'>
<FontAwesomeIcon icon={faCheck} color='#19c84b' /> <FontAwesomeIcon icon={faCheck} color='#19c84b' />
<p>Official</p> <p>Official</p>
</div> </div>
<div className='entry-info-item btntheme2' hidden={gameInfo?.official}> ) : (
<div className='entry-info-item btntheme2'>
<FontAwesomeIcon <FontAwesomeIcon
icon={gameInfo?.verified ? faShieldHalved : faWarning} icon={gameInfo?.verified ? faShieldHalved : faWarning}
color={gameInfo?.verified ? '#19c84b' : '#ffc800'} color={gameInfo?.verified ? '#19c84b' : '#ffc800'}
/> />
<p>{gameInfo?.verified ? 'Verified' : 'Unverified'}</p> <p>{gameInfo?.verified ? 'Verified' : 'Unverified'}</p>
</div> </div>
<div )}
className='entry-info-item btntheme2' {gameInfo?.developer != null && (
hidden={gameInfo?.developer == null} <div className='entry-info-item btntheme2'>
>
<FontAwesomeIcon icon={faCode} color='lightgray' /> <FontAwesomeIcon icon={faCode} color='lightgray' />
<p>Developer: {gameInfo?.developer}</p> <p>Developer: {gameInfo?.developer}</p>
</div> </div>
<div className='entry-info-item btntheme2' hidden={!gameInfo?.official}> )}
<div className='entry-info-item btntheme2'>
<FontAwesomeIcon icon={faDownload} color='lightgray' /> <FontAwesomeIcon icon={faDownload} color='lightgray' />
<p> <p>
{(() => { {(() => {
@@ -102,10 +104,9 @@ export default function ManageGamePopup () {
versions installed versions installed
</p> </p>
</div> </div>
<div {versionsInstalled?.length != 0 && (
className='entry-info-item btntheme2' <>
hidden={versionsInstalled?.length == 0} <div className='entry-info-item btntheme2'>
>
<FontAwesomeIcon icon={faHardDrive} color='lightgray' /> <FontAwesomeIcon icon={faHardDrive} color='lightgray' />
<p> <p>
Size on disk:{' '} Size on disk:{' '}
@@ -157,10 +158,11 @@ export default function ManageGamePopup () {
} }
}} }}
title='Click to uninstall this game. This will NOT remove any progress or any save files.' title='Click to uninstall this game. This will NOT remove any progress or any save files.'
hidden={versionsInstalled?.length == 0}
> >
Uninstall Uninstall
</div> </div>
</>
)}
</div> </div>
</> </>
) )
+14 -10
View File
@@ -68,6 +68,7 @@ export default function ModDownloadsPopup () {
return ( return (
<> <>
{typeof mods != 'number' && showModInfo == null && (
<button <button
className='popup-top-button btntheme1 right-2' className='popup-top-button btntheme1 right-2'
onClick={async () => { onClick={async () => {
@@ -91,10 +92,10 @@ export default function ModDownloadsPopup () {
setMods(1) setMods(1)
} }
}} }}
hidden={typeof mods == 'number' || showModInfo != null}
> >
<FontAwesomeIcon icon={faRefresh} /> <FontAwesomeIcon icon={faRefresh} />
</button> </button>
)}
<p className='text-xl text-center'> <p className='text-xl text-center'>
{!showModInfo {!showModInfo
? versionInfo?.displayName + ' Mod Manager' ? versionInfo?.displayName + ' Mod Manager'
@@ -180,13 +181,12 @@ export default function ModDownloadsPopup () {
> >
v{tab == 0 ? localVersion : v.latestVersion} v{tab == 0 ? localVersion : v.latestVersion}
</span> </span>
<span {tab == 0 && v.latestVersion != localVersion && (
className='text-green-300' <span className='text-green-300'>
hidden={tab != 0 || v.latestVersion == localVersion}
>
{' '} {' '}
(available: v{v.latestVersion}) (available: v{v.latestVersion})
</span> </span>
)}
</p> </p>
<p className='text-yellow-200'> <p className='text-yellow-200'>
Made by {v.creators[0]} Made by {v.creators[0]}
@@ -196,10 +196,13 @@ export default function ModDownloadsPopup () {
</p> </p>
</div> </div>
<div className='flex flex-row items-center h-full gap-2 px-3 ml-auto'> <div className='flex flex-row items-center h-full gap-2 px-3 ml-auto'>
<p className='text-green-400' hidden={tab == 0}> {tab != 0 && (
<p className='text-green-400'>
<FontAwesomeIcon icon={faDownload} />{' '} <FontAwesomeIcon icon={faDownload} />{' '}
{v.downloads.toLocaleString()} {v.downloads.toLocaleString()}
</p> </p>
)}
{tab == 0 && v.latestVersion != localVersion && (
<button <button
className='button btntheme3' className='button btntheme3'
onClick={async () => { onClick={async () => {
@@ -251,11 +254,11 @@ export default function ModDownloadsPopup () {
} }
]) ])
}} }}
hidden={tab != 0 || v.latestVersion == localVersion}
disabled={downloadProgress.length != 0} disabled={downloadProgress.length != 0}
> >
Update Update
</button> </button>
)}
<button <button
className='button btntheme3' className='button btntheme3'
onClick={() => setShowModInfo(v)} onClick={() => setShowModInfo(v)}
@@ -388,9 +391,9 @@ export default function ModDownloadsPopup () {
/>{' '} />{' '}
View changelog View changelog
</button> </button>
{showModInfo.creators.length > 2 && (
<button <button
className='button btntheme2 w-fit' className='button btntheme2 w-fit'
hidden={showModInfo.creators.length < 2}
onClick={async () => { onClick={async () => {
if (!versionInfo) return if (!versionInfo) return
await message(showModInfo.creators.join(', '), { await message(showModInfo.creators.join(', '), {
@@ -399,9 +402,10 @@ export default function ModDownloadsPopup () {
}) })
}} }}
> >
<FontAwesomeIcon icon={faPeopleGroup} color='lightgray' /> View <FontAwesomeIcon icon={faPeopleGroup} color='lightgray' />{' '}
all creators View all creators
</button> </button>
)}
</div> </div>
</div> </div>
)} )}