settings dialog

This commit is contained in:
Novattz
2025-06-24 19:45:29 +02:00
parent 41dba65879
commit 1ac1931a08
7 changed files with 293 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
import { ReactNode } from 'react'
import { ReactNode, useState } from 'react'
import { AppContext, AppContextType } from './AppContext'
import { useGames, useDlcManager, useGameActions, useToasts } from '@/hooks'
import { DlcInfo } from '@/types'
@@ -35,6 +35,18 @@ export const AppProvider = ({ children }: AppProviderProps) => {
const { toasts, removeToast, success, error: showError, warning, info } = useToasts()
// Settings dialog state
const [settingsDialog, setSettingsDialog] = useState({ visible: false })
// Settings handlers
const handleSettingsOpen = () => {
setSettingsDialog({ visible: true })
}
const handleSettingsClose = () => {
setSettingsDialog({ visible: false })
}
// Game action handler with proper error reporting
const handleGameAction = async (gameId: string, action: ActionType) => {
const game = games.find((g) => g.id === gameId)
@@ -180,6 +192,11 @@ export const AppProvider = ({ children }: AppProviderProps) => {
handleDlcConfirm,
handleProgressDialogClose: handleCloseProgressDialog,
// Settings
settingsDialog,
handleSettingsOpen,
handleSettingsClose,
// Toast notifications
showToast,
}