bruno/renderer/components/Sidebar/index.js

61 lines
1.8 KiB
JavaScript
Raw Normal View History

2022-03-07 13:44:49 +01:00
import React from 'react';
2022-03-13 22:38:57 +01:00
import actions from 'providers/Store/actions';
import { useStore } from 'providers/Store';
2021-12-03 20:37:38 +01:00
import Collections from './Collections';
2022-01-31 06:06:29 +01:00
import MenuBar from './MenuBar';
2022-03-07 13:44:49 +01:00
import TitleBar from './TitleBar';
2022-03-13 22:38:57 +01:00
import { IconSearch, IconChevronsRight} from '@tabler/icons';
2022-01-02 09:15:13 +01:00
import StyledWrapper from './StyledWrapper';
2021-12-03 20:37:38 +01:00
const Sidebar = () => {
2022-03-13 22:38:57 +01:00
const [store, storeDispatch] = useStore();
const {
asideWidth,
leftMenuBarOpen
} = store;
const showMenuBar = () => {
storeDispatch({
type: actions.TOGGLE_LEFT_MENUBAR
})
};
2021-12-03 20:37:38 +01:00
return (
2022-03-13 22:38:57 +01:00
<StyledWrapper style={{width: `${asideWidth}px`, minWidth: `${asideWidth}px`}}>
2022-01-31 06:06:29 +01:00
<div className="flex flex-row h-full">
2022-03-13 22:38:57 +01:00
{leftMenuBarOpen && <MenuBar />}
2022-01-01 10:07:34 +01:00
<div className="flex flex-col flex-grow">
2022-03-13 22:38:57 +01:00
<div className="flex flex-col flex-grow">
<TitleBar />
2022-01-31 06:06:29 +01:00
2022-03-13 22:38:57 +01:00
<div className="mt-4 relative collection-filter px-2">
<div className="absolute inset-y-0 left-0 pl-4 flex items-center pointer-events-none">
<span className="text-gray-500 sm:text-sm">
<IconSearch size={16} strokeWidth={1.5}/>
</span>
</div>
<input
type="text"
name="price"
id="price"
className="block w-full pl-7 py-1 sm:text-sm"
placeholder="search"
/>
2022-01-02 09:15:13 +01:00
</div>
2021-12-03 20:37:38 +01:00
2022-03-13 22:38:57 +01:00
<Collections />
</div>
<div
onClick={showMenuBar}
className="flex flex-col px-1 py-2 cursor-pointer text-gray-500 hover:text-gray-700"
>
{!leftMenuBarOpen && <IconChevronsRight size={24} strokeWidth={1.5}/>}
</div>
2021-12-03 20:37:38 +01:00
</div>
</div>
2022-01-02 09:15:13 +01:00
</StyledWrapper>
2021-12-03 20:37:38 +01:00
);
};
export default Sidebar;