- Updated Mini App design guidelines to include detailed instructions on UI changes, accessibility rules, and verification processes. - Refactored multiple components to utilize `MiniAppScreen` and `MiniAppScreenContent` for consistent layout structure across the application. - Improved error handling in `GlobalError` and `NotFound` components by integrating new layout components for better user experience. - Introduced new hooks for admin functionality, streamlining access checks and data loading processes. - Enhanced documentation to reflect changes in design policies and component usage, ensuring clarity for future development.
22 lines
792 B
TypeScript
22 lines
792 B
TypeScript
export interface SessionSlice {
|
|
lang: "ru" | "en";
|
|
/** True when the first visible screen has finished loading; used to hide content until ready(). */
|
|
appContentReady: boolean;
|
|
/** True when GET /api/admin/me returned is_admin: true; used to show Admin link. */
|
|
isAdmin: boolean;
|
|
setLang: (v: "ru" | "en") => void;
|
|
setAppContentReady: (v: boolean) => void;
|
|
setIsAdmin: (v: boolean) => void;
|
|
}
|
|
|
|
type SessionSet = (updater: Partial<SessionSlice> | ((state: SessionSlice) => Partial<SessionSlice>)) => void;
|
|
|
|
export const createSessionSlice = (set: SessionSet): SessionSlice => ({
|
|
lang: "en",
|
|
appContentReady: false,
|
|
isAdmin: false,
|
|
setLang: (v) => set({ lang: v }),
|
|
setAppContentReady: (v) => set({ appContentReady: v }),
|
|
setIsAdmin: (v) => set({ isAdmin: v }),
|
|
});
|