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,22 @@
:root {
--aside-topbar-offset: 60px;
}
.main{ .main{
flex: 1 0; flex: 1 0;
height: inherit;
overflow: auto;
} }
.aside{ .aside{
width: 500px; width: 500px;
height: 100dvh; height: 100dvh;
border-left: 1px solid rgba(17, 20, 24, 0.15); border-left: 1px solid rgba(17, 20, 24, 0.15);
height: inherit;
overflow: auto;
} }
.root { .root {
display: flex; display: flex;
height: calc(100dvh - var(--aside-topbar-offset));
} }

View File

@@ -7,4 +7,5 @@
min-height: 40px; min-height: 40px;
padding: 5px 5px 5px 15px; padding: 5px 5px 5px 15px;
z-index: 0; z-index: 0;
font-weight: 600;
} }

View File

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

View File

@@ -3,15 +3,18 @@
background: #fff; background: #fff;
border-radius: 5px; border-radius: 5px;
border: 1px solid #D6DBE3; border: 1px solid #D6DBE3;
padding: 12px 16px; padding: 10px 16px;
cursor: pointer; cursor: pointer;
&.active{ &.active{
border-color: #88ABDB; 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){ .checkbox:global(.bp4-control.bp4-checkbox){
margin: 0; margin: 0;
@@ -19,4 +22,14 @@
.checkbox:global(.bp4-control.bp4-checkbox) :global .bp4-control-indicator{ .checkbox:global(.bp4-control.bp4-checkbox) :global .bp4-control-indicator{
border-color: #CBCBCB; 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 // @ts-nocheck
import { isEmpty } from 'lodash'; import { isEmpty } from 'lodash';
import * as R from 'ramda';
import { AnchorButton, Button, Intent, Tag, Text } from '@blueprintjs/core'; import { AnchorButton, Button, Intent, Tag, Text } from '@blueprintjs/core';
import { AppToaster, Box, Group, Stack } from '@/components'; import { AppToaster, Box, Group, Stack } from '@/components';
import { import {
@@ -12,6 +13,10 @@ import { FastField, FastFieldProps, Form, Formik } from 'formik';
import { useMatchTransaction } from '@/hooks/query/bank-rules'; import { useMatchTransaction } from '@/hooks/query/bank-rules';
import { MatchingTransactionFormValues } from './types'; import { MatchingTransactionFormValues } from './types';
import { transformToReq } from './utils'; import { transformToReq } from './utils';
import {
WithBankingActionsProps,
withBankingActions,
} from '../withBankingActions';
const initialValues = { const initialValues = {
matched: {}, matched: {},
@@ -60,7 +65,7 @@ export function MatchingBankTransaction() {
function MatchingBankTransactionContent() { function MatchingBankTransactionContent() {
return ( return (
<Box> <Box className={styles.root}>
<PerfectMatchingTransactions /> <PerfectMatchingTransactions />
<GoodMatchingTransactions /> <GoodMatchingTransactions />
<MatchTransactionFooter /> <MatchTransactionFooter />
@@ -84,13 +89,13 @@ function PerfectMatchingTransactions() {
<Box className={styles.matchBar}> <Box className={styles.matchBar}>
<Group spacing={6}> <Group spacing={6}>
<h2 className={styles.matchBarTitle}>Perfect Matchines</h2> <h2 className={styles.matchBarTitle}>Perfect Matchines</h2>
<Tag minimal intent={Intent.SUCCESS}> <Tag minimal round intent={Intent.SUCCESS}>
2 2
</Tag> </Tag>
</Group> </Group>
</Box> </Box>
<Stack spacing={9} style={{ padding: 15 }}> <Stack spacing={9} style={{ padding: '12px 15px' }}>
{matchingTransactions.map((match, index) => ( {matchingTransactions.map((match, index) => (
<MatchTransactionField <MatchTransactionField
key={index} key={index}
@@ -127,7 +132,7 @@ function GoodMatchingTransactions() {
</Stack> </Stack>
</Box> </Box>
<Stack spacing={9} style={{ padding: 15 }}> <Stack spacing={9} style={{ padding: '12px 15px' }}>
{matchingTransactions.map((match, index) => ( {matchingTransactions.map((match, index) => (
<MatchTransaction <MatchTransaction
key={index} key={index}
@@ -171,11 +176,17 @@ export function CategorizeBankTransactionContent() {
return <h1>Categorizing</h1>; return <h1>Categorizing</h1>;
} }
interface MatchTransctionFooterProps extends WithBankingActionsProps {}
/** /**
* Renders the match transactions footer. * Renders the match transactions footer.
* @returns {React.ReactNode} * @returns {React.ReactNode}
*/ */
function MatchTransactionFooter() { const MatchTransactionFooter = R.compose(withBankingActions)(
({ closeMatchingTransactionAside }: MatchTransctionFooterProps) => {
const handleCancelBtnClick = () => {
closeMatchingTransactionAside();
};
return ( return (
<Box className={styles.footer}> <Box className={styles.footer}>
<Box className={styles.footerTotal}> <Box className={styles.footerTotal}>
@@ -196,9 +207,13 @@ function MatchTransactionFooter() {
> >
Match Match
</Button> </Button>
<Button>Cancel</Button>
<Button onClick={handleCancelBtnClick}>Cancel</Button>
</Group> </Group>
</Box> </Box>
</Box> </Box>
); );
} },
);
MatchTransactionFooter.displayName = 'MatchTransactionFooter';