mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-20 06:40:31 +00:00
fix: handle switch button item transaction.
This commit is contained in:
@@ -1,30 +1,22 @@
|
||||
import React from 'react';
|
||||
import styled from 'styled-components';
|
||||
import { Card, FormattedMessage as T } from 'components';
|
||||
import { Card } from 'components';
|
||||
import { ItemManuTransaction } from './utils';
|
||||
import { useItemDetailDrawerContext } from '../ItemDetailDrawerProvider';
|
||||
import ItemPaymentTransactionContent from './ItemPaymentTransactionContent';
|
||||
|
||||
export const ItemPaymentTransactions = () => {
|
||||
const { value } = useItemDetailDrawerContext();
|
||||
const { value, setValue } = useItemDetailDrawerContext();
|
||||
|
||||
// handle item change.
|
||||
const handleItemChange = (item) => {
|
||||
setValue(item);
|
||||
};
|
||||
|
||||
return (
|
||||
<Card>
|
||||
<ItemManuTransactions>
|
||||
<T id={'item.drawer_transactions_by'} />
|
||||
<ItemManuTransaction />
|
||||
</ItemManuTransactions>
|
||||
<ItemManuTransaction onChange={handleItemChange} />
|
||||
<ItemPaymentTransactionContent tansactionType={value} />
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
const ItemManuTransactions = styled.div`
|
||||
display: flex;
|
||||
align-items: center;
|
||||
color: #727983;
|
||||
.bp3-button {
|
||||
padding-left: 6px;
|
||||
font-weight: 500;
|
||||
}
|
||||
`;
|
||||
|
||||
Reference in New Issue
Block a user