()
| 52 | ]; |
| 53 | |
| 54 | export function SideBar(): JSX.Element { |
| 55 | const { baseURL } = useSettings(); |
| 56 | const history = useHistory(); |
| 57 | const { navbarTop, sideBarLocked, setSideBarLocked } = useSettings(); |
| 58 | const [ref, hoveringOverSideBar] = useHover<HTMLDivElement>(sideBarLocked); |
| 59 | const windowSize = useWindowSize(); |
| 60 | |
| 61 | const appMenuItems: MenuItemMinimial[] = React.useMemo(() => { |
| 62 | return [ |
| 63 | { |
| 64 | icon: <FaPlus />, |
| 65 | label: 'new resource', |
| 66 | helper: 'Create a new Resource, based on a Class (n)', |
| 67 | onClick: () => { |
| 68 | history.push(paths.new); |
| 69 | }, |
| 70 | }, |
| 71 | { |
| 72 | icon: <FaUser />, |
| 73 | label: 'user settings', |
| 74 | helper: 'See and edit the current Agent / User (u)', |
| 75 | onClick: () => { |
| 76 | history.push(paths.agentSettings); |
| 77 | }, |
| 78 | }, |
| 79 | { |
| 80 | icon: <FaCog />, |
| 81 | label: 'theme settings', |
| 82 | helper: 'Edit the theme, current Agent, and more. (t)', |
| 83 | onClick: () => { |
| 84 | history.push(paths.themeSettings); |
| 85 | }, |
| 86 | }, |
| 87 | { |
| 88 | icon: <FaKeyboard />, |
| 89 | label: 'keyboard shortcuts', |
| 90 | helper: 'View the keyboard shortcuts (?)', |
| 91 | onClick: () => { |
| 92 | history.push(paths.shortcuts); |
| 93 | }, |
| 94 | }, |
| 95 | { |
| 96 | icon: <FaInfo />, |
| 97 | label: 'about', |
| 98 | helper: 'Welcome page, tells about this app', |
| 99 | onClick: () => { |
| 100 | history.push(paths.about); |
| 101 | }, |
| 102 | }, |
| 103 | ]; |
| 104 | }, []); |
| 105 | |
| 106 | const isWideScreen = React.useCallback( |
| 107 | () => windowSize.width > SIDEBAR_TOGGLE_WIDTH, |
| 108 | [windowSize], |
| 109 | ); |
| 110 | |
| 111 | /** |
nothing calls this directly
no test coverage detected