mirror of
https://github.com/Novattz/creamlinux-installer.git
synced 2026-01-28 14:22:49 -05:00
settings dialog
This commit is contained in:
@@ -49,6 +49,11 @@ export interface AppContextType {
|
||||
handleGameAction: (gameId: string, action: ActionType) => Promise<void>
|
||||
handleDlcConfirm: (selectedDlcs: DlcInfo[]) => void
|
||||
|
||||
// Settings
|
||||
settingsDialog: { visible: boolean }
|
||||
handleSettingsOpen: () => void
|
||||
handleSettingsClose: () => void
|
||||
|
||||
// Toast notifications
|
||||
showToast: (
|
||||
message: string,
|
||||
|
||||
@@ -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,
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user