mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 13:50:31 +00:00
faet: Account Transcations.
This commit is contained in:
49
src/containers/CashFlow/AccountTransactions/utils.js
Normal file
49
src/containers/CashFlow/AccountTransactions/utils.js
Normal file
@@ -0,0 +1,49 @@
|
||||
import React from 'react';
|
||||
import classNames from 'classnames';
|
||||
|
||||
import {
|
||||
Button,
|
||||
PopoverInteractionKind,
|
||||
MenuItem,
|
||||
Classes,
|
||||
Position,
|
||||
} from '@blueprintjs/core';
|
||||
|
||||
import { Select } from '@blueprintjs/select';
|
||||
import { Icon } from 'components';
|
||||
|
||||
export const CashFlowMenuItems = ({ text, items, onItemSelect }) => {
|
||||
// Menu items renderer.
|
||||
const itemsRenderer = (item, { handleClick, modifiers, query }) => (
|
||||
<MenuItem text={item.name} label={item.label} onClick={handleClick} />
|
||||
);
|
||||
|
||||
const handleCashFlowMenuSelect = (type) => {
|
||||
onItemSelect && onItemSelect(type);
|
||||
};
|
||||
|
||||
return (
|
||||
<Select
|
||||
items={items}
|
||||
itemRenderer={itemsRenderer}
|
||||
onItemSelect={handleCashFlowMenuSelect}
|
||||
popoverProps={{
|
||||
minimal: true,
|
||||
position: Position.BOTTOM_LEFT,
|
||||
interactionKind: PopoverInteractionKind.CLICK,
|
||||
modifiers: {
|
||||
offset: { offset: '0, 4' },
|
||||
},
|
||||
}}
|
||||
filterable={false}
|
||||
>
|
||||
<Button
|
||||
text={text}
|
||||
icon={<Icon icon={'plus-24'} iconSize={20} />}
|
||||
// rightIcon={'caret-down'}
|
||||
// className={classNames(Classes.MINIMAL, 'button--table-views')}
|
||||
minimal={true}
|
||||
/>
|
||||
</Select>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user