Commit 52c5bb3b by G

a common AmountWrapper component for all

parent 436ec37f
...@@ -51,30 +51,12 @@ const TransactionInformationsItem = ({ paymentType, reference, date, amount, sta ...@@ -51,30 +51,12 @@ const TransactionInformationsItem = ({ paymentType, reference, date, amount, sta
const AmountColorRenderer = ({ status, amount }: { status: string; amount: number }) => { const AmountColorRenderer = ({ status, amount }: { status: string; amount: number }) => {
if (status === "SUCCESS") { if (status === "SUCCESS") {
return ( return <AmountWrapper color="secondary">{amount}</AmountWrapper>;
<AmountWrapper color="secondary">
<Text variant={"white"} fontWeight={"bold"}>
{amount}
</Text>
</AmountWrapper>
);
} }
if (status === "INITIATED") { if (status === "INITIATED") {
return ( return <AmountWrapper color="softYellow">{amount}</AmountWrapper>;
<AmountWrapper color="softYellow">
<Text variant={"white"} fontWeight={"bold"}>
{amount}
</Text>
</AmountWrapper>
);
} }
return ( return <AmountWrapper color="softRed">{amount}</AmountWrapper>;
<AmountWrapper color="softRed">
<Text variant={"white"} fontWeight={"bold"}>
{amount}
</Text>
</AmountWrapper>
);
}; };
const AmountWrapper = ({ const AmountWrapper = ({
...@@ -82,8 +64,10 @@ const AmountWrapper = ({ ...@@ -82,8 +64,10 @@ const AmountWrapper = ({
children, children,
}: { color: "secondary" | "softYellow" | "softRed"; children: React.ReactNode }) => { }: { color: "secondary" | "softYellow" | "softRed"; children: React.ReactNode }) => {
return ( return (
<Box backgroundColor={color} px={"m"} py={"xs"} borderRadius={10}> <Box backgroundColor={color} px={"m"} py={"xs"} borderRadius={7}>
{children} <Text variant={"white"} fontWeight={"bold"}>
{children} F
</Text>
</Box> </Box>
); );
}; };
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment