refactor: payment made details total lines.

This commit is contained in:
a.bouhuolia
2021-12-21 16:55:35 +02:00
parent 1d159c2757
commit 7987f68aa3

View File

@@ -1,8 +1,13 @@
import React from 'react'; import React from 'react';
import clsx from 'classnames'; import styled from 'styled-components';
import { T, TotalLines, TotalLine } from 'components'; import {
import PaymentDrawerCls from './PaymentMadeDrawer.module.scss'; T,
TotalLines,
TotalLine,
TotalLineBorderStyle,
TotalLineTextStyle,
} from 'components';
import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider'; import { usePaymentMadeDetailContext } from './PaymentMadeDetailProvider';
/** /**
@@ -12,19 +17,26 @@ export default function PaymentMadeDetailFooter() {
const { paymentMade } = usePaymentMadeDetailContext(); const { paymentMade } = usePaymentMadeDetailContext();
return ( return (
<div className={clsx(PaymentDrawerCls.detail_panel_footer)}> <PaymentMadeFooterRoot>
<TotalLines> <PaymentMadeTotalLines labelColWidth={'180px'} amountColWidth={'180px'}>
<TotalLine <TotalLine
title={<T id={'payment_made.details.subtotal'} />} title={<T id={'payment_made.details.subtotal'} />}
value={paymentMade.amount} value={paymentMade.amount}
className={clsx(PaymentDrawerCls.total_line_subtotal)} borderStyle={TotalLineBorderStyle.SingleDark}
/> />
<TotalLine <TotalLine
title={<T id={'payment_made.details.total'} />} title={<T id={'payment_made.details.total'} />}
value={paymentMade.formatted_amount} value={paymentMade.formatted_amount}
className={clsx(PaymentDrawerCls.total_line_total)} borderStyle={TotalLineBorderStyle.DoubleDark}
textStyle={TotalLineTextStyle.Bold}
/> />
</TotalLines> </PaymentMadeTotalLines>
</div> </PaymentMadeFooterRoot>
); );
} }
export const PaymentMadeFooterRoot = styled.div``;
export const PaymentMadeTotalLines = styled(TotalLines)`
margin-left: auto;
`;