mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-18 05:40:31 +00:00
feat(webapp): add FCY/BCY switch to the account transactions
This commit is contained in:
@@ -0,0 +1,47 @@
|
||||
import React from 'react';
|
||||
import { Button, ButtonGroup } from '@blueprintjs/core';
|
||||
import styled from 'styled-components';
|
||||
import { useAccountDrawerTableOptionsContext } from './AccountDrawerTableOptionsProvider';
|
||||
|
||||
export function AccountDrawerTableHeader() {
|
||||
const {
|
||||
setBCYCurrencyType,
|
||||
setFYCCurrencyType,
|
||||
isBCYCurrencyType,
|
||||
isFYCCurrencyType,
|
||||
} = useAccountDrawerTableOptionsContext();
|
||||
|
||||
const handleBCYBtnClick = () => {
|
||||
setBCYCurrencyType();
|
||||
};
|
||||
const handleFCYBtnClick = () => {
|
||||
setFYCCurrencyType();
|
||||
};
|
||||
|
||||
return (
|
||||
<TableHeaderRoot>
|
||||
<ButtonGroup>
|
||||
<Button
|
||||
small
|
||||
outlined
|
||||
onClick={handleFCYBtnClick}
|
||||
active={isFYCCurrencyType}
|
||||
>
|
||||
FCY
|
||||
</Button>
|
||||
<Button
|
||||
small
|
||||
outlined
|
||||
onClick={handleBCYBtnClick}
|
||||
active={isBCYCurrencyType}
|
||||
>
|
||||
BCY
|
||||
</Button>
|
||||
</ButtonGroup>
|
||||
</TableHeaderRoot>
|
||||
);
|
||||
}
|
||||
|
||||
const TableHeaderRoot = styled.div`
|
||||
margin-bottom: 1rem;
|
||||
`;
|
||||
Reference in New Issue
Block a user