diff --git a/client/src/components/Items/ItemsCategoryList.js b/client/src/components/Items/ItemsCategoryList.js index a8c5f5388..5da794f8b 100644 --- a/client/src/components/Items/ItemsCategoryList.js +++ b/client/src/components/Items/ItemsCategoryList.js @@ -5,25 +5,34 @@ import DialogConnect from 'connectors/Dialog.connector'; import LoadingIndicator from 'components/LoadingIndicator'; import { compose } from 'utils'; import DataTable from 'components/DataTable'; -import { Button, Popover, Menu, MenuItem, Position } from '@blueprintjs/core'; +import { + Button, + Popover, + Menu, + MenuItem, + Position, + Classes, + Tooltip, +} from '@blueprintjs/core'; const ItemsCategoryList = ({ categories, onFetchData, onDeleteCategory, onEditCategory, - openDialog + openDialog, + count, }) => { - const handelEditCategory = category => () => { + const handelEditCategory = (category) => () => { openDialog('item-form', { action: 'edit', id: category.id }); onEditCategory(category.id); }; - const handleDeleteCategory = category => () => { + const handleDeleteCategory = (category) => () => { onDeleteCategory(category); }; - const actionMenuList = category => ( + const actionMenuList = (category) => ( {count}, + className: 'count', + width: 50, }, { id: 'actions', @@ -62,9 +76,9 @@ const ItemsCategoryList = ({ ), className: 'actions', - width: 50 + width: 50, // canResize: false - } + }, ], [] ); @@ -73,6 +87,7 @@ const ItemsCategoryList = ({ onFetchData && onFetchData(); }, []); + return ( ); diff --git a/client/src/components/Preferences/PreferencesContent.js b/client/src/components/Preferences/PreferencesContent.js index 4e2cd404e..33fad9d86 100644 --- a/client/src/components/Preferences/PreferencesContent.js +++ b/client/src/components/Preferences/PreferencesContent.js @@ -2,14 +2,14 @@ import React from 'react'; import PreferencesTopbar from 'components/Preferences/PreferencesTopbar'; import PreferencesContentRoute from 'components/Preferences/PreferencesContentRoute'; -export default function() { +export default function () { return ( -
- - -
+
+ + +
- ) -} \ No newline at end of file + ); +} diff --git a/client/src/components/Sidebar/SidebarContainer.js b/client/src/components/Sidebar/SidebarContainer.js index 77c0c670f..35395c907 100644 --- a/client/src/components/Sidebar/SidebarContainer.js +++ b/client/src/components/Sidebar/SidebarContainer.js @@ -1,11 +1,70 @@ -import React from 'react'; +import * as React from 'react'; +import { Scrollbar } from 'react-scrollbars-custom'; + +const style = { + holder: { + position: 'relative', + width: '100%', + height: '100%', + }, + + wrapper: { + position: 'absolute', + top: 0, + left: 0, + bottom: 0, + right: 0, + }, + + content: { + boxSizing: 'border-box', + }, + + track: { + common: { + position: 'absolute', + overflow: 'hidden', + borderRadius: 4, + background: 'rgba(0,0,0,.1)', + userSelect: 'none', + }, + x: { + height: 10, + width: 'calc(100% - 20px)', + bottom: 0, + left: 10, + }, + y: { + width: 10, + height: 'calc(100% - 20px)', + top: 10, + }, + }, + + thumb: { + common: { + cursor: 'pointer', + borderRadius: 4, + background: 'rgba(0,0,0,.4)', + }, + x: { + height: '100%', + width: 0, + }, + y: { + width: '100%', + height: 0, + }, + }, +}; export default function SidebarContainer(props) { return ( -
diff --git a/client/src/containers/Dashboard/Preferences/UsersList.js b/client/src/containers/Dashboard/Preferences/UsersList.js index 9971eec5b..5eefd0b1d 100644 --- a/client/src/containers/Dashboard/Preferences/UsersList.js +++ b/client/src/containers/Dashboard/Preferences/UsersList.js @@ -1,10 +1,6 @@ -import React, {useState} from 'react'; -import {useAsync} from 'react-use'; -import { - GridComponent, - ColumnsDirective, - ColumnDirective, -} from '@syncfusion/ej2-react-grids'; +import React, { useState, useMemo, useCallback } from 'react'; +import { useAsync } from 'react-use'; +import DataTable from 'components/DataTable'; import { Alert, Popover, @@ -17,9 +13,12 @@ import { } from '@blueprintjs/core'; import Icon from 'components/Icon'; import LoadingIndicator from 'components/LoadingIndicator'; -import {snakeCase} from 'lodash'; -import connector from 'connectors/UsersList.connector'; +import { snakeCase } from 'lodash'; +import UserListConnect from 'connectors/UsersList.connector'; import AppToaster from 'components/AppToaster'; +import { compose } from 'utils'; +import DialogConnect from 'connectors/Dialog.connector'; +import DashboardConnect from 'connectors/Dashboard.connector'; function UsersListPreferences({ fetchUsers, @@ -27,22 +26,23 @@ function UsersListPreferences({ openDialog, closeDialog, deleteUser, + onFetchData, }) { const [deleteUserState, setDeleteUserState] = useState(false); const [inactiveUserState, setInactiveUserState] = useState(false); const asyncHook = useAsync(async () => { - await Promise.all([ - fetchUsers(), - ]); + await Promise.all([fetchUsers()]); }, []); - const onInactiveUser = (user) => { + const onInactiveUser = (user) => {}; + const onDeleteUser = (user) => { + setDeleteUserState(user); + }; + const handleCancelUserDelete = () => { + setDeleteUserState(false); }; - - const onDeleteUser = (user) => { setDeleteUserState(user); }; - const handleCancelUserDelete = () => { setDeleteUserState(false); }; const onEditUser = (user) => () => { const form = Object.keys(user).reduce((obj, key) => { @@ -51,11 +51,13 @@ function UsersListPreferences({ return obj; }, {}); - openDialog('user-form', { action: 'edit', user: form, }); + openDialog('user-form', { action: 'edit', user: form }); }; const handleConfirmUserDelete = () => { - if (!deleteUserState) { return; } + if (!deleteUserState) { + return; + } deleteUser(deleteUserState.id).then((response) => { setDeleteUserState(false); @@ -65,79 +67,96 @@ function UsersListPreferences({ }); }; - const actionMenuList = (user) => - ( - - + const actionMenuList = (user) => ( + + + - onInactiveUser(user)} /> - onDeleteUser(user)} /> - ); + onInactiveUser(user)} /> + onDeleteUser(user)} /> + + ); + console.log(usersList, 'X'); + + const columns = useMemo( + () => [ + { + id: 'full_name', + Header: 'Full Name', + accessor: 'full_name', + width: 170, + }, + { + id: 'email', + Header: 'Email', + accessor: 'email', + width: 150, + }, + { + id: 'phone_number', + Header: 'Phone Number', + accessor: 'phone_number', + width: 150, + }, + { + id: 'active', + Header: 'Status', + accessor: (user) => + user.active ? Active : Inactivate, + width: 50, + }, + { + id: 'actions', + Header: '', + Cell: ({ cell }) => ( + +