Add fullscreen functionality: introduce API methods for getting and updating fullscreen settings, implement caching for fullscreen state, and integrate fullscreen toggle in AdminSettings. Remove unused fullscreen icons from Layout component.

This commit is contained in:
PEDZEO
2026-01-20 02:17:22 +03:00
parent e0df8a1a16
commit 64acfbee72
4 changed files with 91 additions and 27 deletions

View File

@@ -11,6 +11,10 @@ export interface AnimationEnabled {
enabled: boolean
}
export interface FullscreenEnabled {
enabled: boolean
}
const BRANDING_CACHE_KEY = 'cabinet_branding'
const LOGO_PRELOADED_KEY = 'cabinet_logo_preloaded'
@@ -121,4 +125,21 @@ export const brandingApi = {
const response = await apiClient.patch<AnimationEnabled>('/cabinet/branding/animation', { enabled })
return response.data
},
// Get fullscreen enabled (public, no auth required)
getFullscreenEnabled: async (): Promise<FullscreenEnabled> => {
try {
const response = await apiClient.get<FullscreenEnabled>('/cabinet/branding/fullscreen')
return response.data
} catch {
// If endpoint doesn't exist, default to disabled
return { enabled: false }
}
},
// Update fullscreen enabled (admin only)
updateFullscreenEnabled: async (enabled: boolean): Promise<FullscreenEnabled> => {
const response = await apiClient.patch<FullscreenEnabled>('/cabinet/branding/fullscreen', { enabled })
return response.data
},
}