A bunch of getters and setters for client-side app settings
| 66 | |
| 67 | /** A bunch of getters and setters for client-side app settings */ |
| 68 | interface AppSettings { |
| 69 | /** Whether the App should render in dark mode. Checks user preferences. */ |
| 70 | darkMode: boolean; |
| 71 | /** 'always', 'never' or 'auto' */ |
| 72 | darkModeSetting: DarkModeOption; |
| 73 | /** When calling this with undefined (no arguments), it uses the browser's preference */ |
| 74 | setDarkMode: (b?: boolean) => void; |
| 75 | /** CSS value for the primary color */ |
| 76 | mainColor: string; |
| 77 | setMainColor: (s: string) => void; |
| 78 | /** The URL that points to the Drive shown in the SideBar */ |
| 79 | baseURL: string; |
| 80 | setBaseURL: (s: string) => void; |
| 81 | /** If the navbar should be at the top of the page */ |
| 82 | navbarTop: boolean; |
| 83 | setNavbarTop: (s: boolean) => void; |
| 84 | /** If the navbar should be floating instead of being fixed at the top or bottom */ |
| 85 | navbarFloating: boolean; |
| 86 | setNavbarFloating: (s: boolean) => void; |
| 87 | /** If the Sidebar should be locked to the side */ |
| 88 | sideBarLocked: boolean; |
| 89 | setSideBarLocked: (s: boolean) => void; |
| 90 | /** The currently signed in Agent */ |
| 91 | agent: Agent | null; |
| 92 | setAgent: (a: Agent | null) => void; |
| 93 | } |
| 94 | |
| 95 | /** Hook for using App Settings, such as theme and darkmode */ |
| 96 | export const useSettings = (): AppSettings => { |
nothing calls this directly
no outgoing calls
no test coverage detected