mirror of
https://github.com/chillpadclub/bedolaga-cabinet.git
synced 2026-07-29 18:13:47 +00:00
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:
@@ -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
|
||||
},
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user