mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-17 05:10:31 +00:00
- feat: Sales estimates APIs.
- feat: Sales invoices APIs. - feat: Sales receipts APIs. - WIP: Sales payment receipts. - WIP: Purchases bills. - WIP: Purchases payments made.
This commit is contained in:
44
client/src/components/Dashboard/DashboardActionViewsList.js
Normal file
44
client/src/components/Dashboard/DashboardActionViewsList.js
Normal file
@@ -0,0 +1,44 @@
|
||||
import React, { useMemo } from 'react';
|
||||
import classNames from 'classnames';
|
||||
import {
|
||||
Button,
|
||||
Classes,
|
||||
MenuItem,
|
||||
Menu,
|
||||
Popover,
|
||||
PopoverInteractionKind,
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { Icon } from 'components';
|
||||
|
||||
export default function DashboardActionViewsList({
|
||||
resourceName,
|
||||
views
|
||||
}) {
|
||||
const history = useHistory();
|
||||
|
||||
const handleClickViewItem = (view) => {
|
||||
history.push(view ? `/${resourceName}/${view.id}/custom_view` : '/accounts');
|
||||
};
|
||||
const viewsMenuItems = views.map((view) => {
|
||||
return <MenuItem onClick={() => handleClickViewItem(view)} text={view.name} />;
|
||||
});
|
||||
|
||||
return (
|
||||
<Popover
|
||||
content={<Menu>{viewsMenuItems}</Menu>}
|
||||
minimal={true}
|
||||
interactionKind={PopoverInteractionKind.HOVER}
|
||||
position={Position.BOTTOM_LEFT}
|
||||
>
|
||||
<Button
|
||||
className={classNames(Classes.MINIMAL, 'button--table-views')}
|
||||
icon={<Icon icon="table-16" iconSize={16} />}
|
||||
text={<T id={'table_views'} />}
|
||||
rightIcon={'caret-down'}
|
||||
/>
|
||||
</Popover>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user