fix: mathcing bank transaction styling

This commit is contained in:
Ahmed Bouhuolia
2024-06-26 22:25:59 +02:00
parent 87bf29f28c
commit 7edf268e75
5 changed files with 82 additions and 35 deletions

View File

@@ -1,14 +1,21 @@
.root {
position: relative;
padding-bottom: 110px;
}
.transaction {
}
.matchBar{
padding: 12px 18px;
padding: 12px 14px;
background: #fff;
border-bottom: 1px solid #E1E2E9;
border-top: 1px solid #E1E2E9;
&:not(:first-of-type) {
border-top: 1px solid #E1E2E9;
}
}
.matchBarTitle {
@@ -18,14 +25,17 @@
.footer {
background-color: #fff;
position: fixed;
bottom: 0;
width: 100%;
}
.footerActions {
padding: 14px 16px;
border-top: 1px solid #E1E2E9;
border-top: 1px solid #d8d9d9;
}
.footerTotal {
padding: 8px 16px;
border: 1px solid #E1E2E9;
border-top: 1px solid #d8d9d9;
}

View File

@@ -3,20 +3,33 @@
background: #fff;
border-radius: 5px;
border: 1px solid #D6DBE3;
padding: 12px 16px;
padding: 10px 16px;
cursor: pointer;
&.active{
border-color: #88ABDB;
box-shadow: 0 0 0 2px rgba(136, 171, 219, 0.2);
}
&:hover:not(.active){
border-color: #c0c0c0;
}
}
.checkbox:global(.bp4-control.bp4-checkbox){
margin: 0;
}
.checkbox:global(.bp4-control.bp4-checkbox) :global .bp4-control-indicator{
border-color: #CBCBCB;
}
.checkbox:global(.bp4-control.bp4-checkbox) :global .bp4-control-indicator{
margin-right: 4px;
margin-left: 0;
height: 16px;
width: 16px;
}
.label {
color: #10161A;
font-size: 15px;
}

View File

@@ -1,5 +1,6 @@
// @ts-nocheck
import { isEmpty } from 'lodash';
import * as R from 'ramda';
import { AnchorButton, Button, Intent, Tag, Text } from '@blueprintjs/core';
import { AppToaster, Box, Group, Stack } from '@/components';
import {
@@ -12,6 +13,10 @@ import { FastField, FastFieldProps, Form, Formik } from 'formik';
import { useMatchTransaction } from '@/hooks/query/bank-rules';
import { MatchingTransactionFormValues } from './types';
import { transformToReq } from './utils';
import {
WithBankingActionsProps,
withBankingActions,
} from '../withBankingActions';
const initialValues = {
matched: {},
@@ -60,7 +65,7 @@ export function MatchingBankTransaction() {
function MatchingBankTransactionContent() {
return (
<Box>
<Box className={styles.root}>
<PerfectMatchingTransactions />
<GoodMatchingTransactions />
<MatchTransactionFooter />
@@ -84,13 +89,13 @@ function PerfectMatchingTransactions() {
<Box className={styles.matchBar}>
<Group spacing={6}>
<h2 className={styles.matchBarTitle}>Perfect Matchines</h2>
<Tag minimal intent={Intent.SUCCESS}>
<Tag minimal round intent={Intent.SUCCESS}>
2
</Tag>
</Group>
</Box>
<Stack spacing={9} style={{ padding: 15 }}>
<Stack spacing={9} style={{ padding: '12px 15px' }}>
{matchingTransactions.map((match, index) => (
<MatchTransactionField
key={index}
@@ -127,7 +132,7 @@ function GoodMatchingTransactions() {
</Stack>
</Box>
<Stack spacing={9} style={{ padding: 15 }}>
<Stack spacing={9} style={{ padding: '12px 15px' }}>
{matchingTransactions.map((match, index) => (
<MatchTransaction
key={index}
@@ -171,34 +176,44 @@ export function CategorizeBankTransactionContent() {
return <h1>Categorizing</h1>;
}
interface MatchTransctionFooterProps extends WithBankingActionsProps {}
/**
* Renders the match transactions footer.
* @returns {React.ReactNode}
*/
function MatchTransactionFooter() {
return (
<Box className={styles.footer}>
<Box className={styles.footerTotal}>
<Group position={'apart'}>
<AnchorButton small minimal intent={Intent.PRIMARY}>
Add Reconcile Transaction +
</AnchorButton>
<Text style={{ fontSize: 13 }}>Pending $10,000</Text>
</Group>
</Box>
const MatchTransactionFooter = R.compose(withBankingActions)(
({ closeMatchingTransactionAside }: MatchTransctionFooterProps) => {
const handleCancelBtnClick = () => {
closeMatchingTransactionAside();
};
return (
<Box className={styles.footer}>
<Box className={styles.footerTotal}>
<Group position={'apart'}>
<AnchorButton small minimal intent={Intent.PRIMARY}>
Add Reconcile Transaction +
</AnchorButton>
<Text style={{ fontSize: 13 }}>Pending $10,000</Text>
</Group>
</Box>
<Box className={styles.footerActions}>
<Group spacing={10}>
<Button
intent={Intent.PRIMARY}
style={{ minWidth: 85 }}
type="submit"
>
Match
</Button>
<Button>Cancel</Button>
</Group>
<Box className={styles.footerActions}>
<Group spacing={10}>
<Button
intent={Intent.PRIMARY}
style={{ minWidth: 85 }}
type="submit"
>
Match
</Button>
<Button onClick={handleCancelBtnClick}>Cancel</Button>
</Group>
</Box>
</Box>
</Box>
);
}
);
},
);
MatchTransactionFooter.displayName = 'MatchTransactionFooter';