mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
feat(design): fix issues in sidebar design.
feat(sales): reference number auto-increment optimizations. fix(payments): payment receive/made statement.
This commit is contained in:
@@ -1,10 +1,11 @@
|
||||
import React from 'react';
|
||||
import ListSelect from 'components/ListSelect';
|
||||
import { Button, MenuItem } from '@blueprintjs/core';
|
||||
import { FormattedMessage as T } from 'react-intl';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { Icon } from 'components';
|
||||
import { Position } from '@blueprintjs/core';
|
||||
import quickNewOptions from 'common/quickNewOptions';
|
||||
import { Select } from '@blueprintjs/select';
|
||||
|
||||
/**
|
||||
* Quick New Dropdown.
|
||||
@@ -12,26 +13,29 @@ import quickNewOptions from 'common/quickNewOptions';
|
||||
function QuickNewDropdown() {
|
||||
const history = useHistory();
|
||||
|
||||
const handleClickQuickNew = ({path }) => {
|
||||
const handleClickQuickNew = ({ path }) => {
|
||||
history.push(`/${path}`);
|
||||
};
|
||||
|
||||
const itemRenderer = (item, { handleClick, modifiers, query }) => (
|
||||
<MenuItem text={item.name} label={item.label} onClick={handleClick} />
|
||||
);
|
||||
|
||||
return (
|
||||
<ListSelect
|
||||
<Select
|
||||
items={quickNewOptions}
|
||||
itemRenderer={itemRenderer}
|
||||
onItemSelect={(type) => handleClickQuickNew(type)}
|
||||
textProp={'name'}
|
||||
labelProp={'label'}
|
||||
filterable={false}
|
||||
popoverProps={{ minimal: false, position: Position.BOTTOM }}
|
||||
defaultText={'Select'}
|
||||
buttonProps={{
|
||||
text: <T id={'quick_new'} />,
|
||||
icon: <Icon icon={'plus-24'} iconSize={20} />,
|
||||
minimal: true,
|
||||
}}
|
||||
className={'form-group-quick-new-downDrop'}
|
||||
/>
|
||||
className={'form-group--quick-new-downDrop'}
|
||||
filterable={false}
|
||||
>
|
||||
<Button
|
||||
text={<T id={'quick_new'} />}
|
||||
icon={<Icon icon={'plus-24'} iconSize={20} />}
|
||||
minimal={true}
|
||||
/>
|
||||
</Select>
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user