MCPcopy Create free account
hub / github.com/atomicdata-dev/atomic-data-browser / SideBar

Function SideBar

data-browser/src/components/SideBar.tsx:54–152  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

52];
53
54export 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 /**

Callers

nothing calls this directly

Calls 3

useSettingsFunction · 0.90
useHoverFunction · 0.90
useWindowSizeFunction · 0.90

Tested by

no test coverage detected