Fixed various smaller issues

This commit is contained in:
grimsi
2025-09-03 20:26:44 +02:00
parent 153001fdfe
commit 4ae78b01a8
8 changed files with 68 additions and 16 deletions
@@ -35,9 +35,11 @@ export default function GameRequestView() {
const gameRequests = useSnapshot(gameRequestState).gameRequests;
const [areGameRequestsEnabled, setAreGameRequestsEnabled] = useState(false);
const [areGuestsAllowedToRequestGames, setAreGuestsAllowedToRequestGames] = useState(false);
useEffect(() => {
ConfigEndpoint.areGameRequestsEnabled().then(setAreGameRequestsEnabled);
ConfigEndpoint.areGuestsAllowedToRequestGames().then(setAreGuestsAllowedToRequestGames);
}, []);
const [searchTerm, setSearchTerm] = useState("");
@@ -168,7 +170,7 @@ export default function GameRequestView() {
color="primary"
startContent={<PlusCircle weight="fill"/>}
onPress={requestGameModal.onOpen}
isDisabled={!areGameRequestsEnabled}>
isDisabled={!areGameRequestsEnabled || (!auth.state.user && !areGuestsAllowedToRequestGames)}>
Request a Game
</Button>
</div>
+10 -12
View File
@@ -94,18 +94,16 @@ export default function MainLayout() {
</Tooltip>
</NavbarContent>}
<NavbarContent justify="end" className="items-center">
{auth.state.user &&
<NavbarItem>
<Tooltip content="Request a game" placement="bottom">
<Button color="primary"
isDisabled={window.location.pathname.startsWith("/requests")}
onPress={() => navigate("/requests")}
startContent={<Disc weight="fill"/>}>
Requests
</Button>
</Tooltip>
</NavbarItem>
}
<NavbarItem>
<Tooltip content="Request a game" placement="bottom">
<Button color="primary"
isDisabled={window.location.pathname.startsWith("/requests")}
onPress={() => navigate("/requests")}
startContent={<Disc weight="fill"/>}>
Requests
</Button>
</Tooltip>
</NavbarItem>
{isAdmin(auth) &&
<NavbarItem>
<Tooltip content="View library scan results" placement="bottom">