feat(webapp): add FCY/BCY switch to the account transactions

This commit is contained in:
a.bouhuolia
2023-04-19 06:15:13 +02:00
parent b2f3585047
commit 672a1bbb82
5 changed files with 153 additions and 54 deletions

View File

@@ -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;
`;