feat: enhance Mini App design guidelines and refactor layout components
- 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.
This commit is contained in:
21
webapp-next/src/store/slices/session-slice.ts
Normal file
21
webapp-next/src/store/slices/session-slice.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
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 }),
|
||||
});
|
||||
Reference in New Issue
Block a user