Skip to content

Commit

Permalink
chore: formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
abhiShandy committed Sep 24, 2023
1 parent 61a5178 commit 66ba79e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 22 deletions.
37 changes: 17 additions & 20 deletions components/atoms/Card/Progress/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,40 +3,36 @@ import { useEffect } from 'react';
import { AiOutlineArrowRight } from 'react-icons/ai';
import { HiOutlineArrowNarrowRight } from 'react-icons/hi';

const CardProgress = ({
title,
amount,
currency,
operations,
link,
}) => {
const CardProgress = ({ title, amount, currency, operations, link }) => {
const somme = operations.reduce(
(accumulateur, objet) => accumulateur + objet.amount,
0,
);
const percent = (somme / amount) * 100;

useEffect(() => { }, [somme]);
useEffect(() => {}, [somme]);

return (
<Link href={link} legacyBehavior>
<div
role="progressbar"
className={`${percent <= 50
? 'bg-[#F9F1FC]'
: percent > 50 && percent <= 75
className={`${
percent <= 50
? 'bg-[#F9F1FC]'
: percent > 50 && percent <= 75
? 'bg-[rgba(255,69,0,0.2)]'
: 'bg-[#E3F9E9]'
} py-4 px-4 flex justify-between items-center pr-10 rounded-lg cursor-pointer hover:shadow-sm`}
} py-4 px-4 flex justify-between items-center pr-10 rounded-lg cursor-pointer hover:shadow-sm`}
>
<div className="flex items-center gap-4">
<div
className={`radial-progress ${percent <= 50
? 'text-purple'
: percent > 50 && percent <= 75
className={`radial-progress ${
percent <= 50
? 'text-purple'
: percent > 50 && percent <= 75
? 'text-[#FF4500]'
: 'text-[#2ABB52]'
}`}
}`}
style={{ '--value': percent, '--size': '4rem' }}
>
{percent.toFixed(0)}%
Expand All @@ -55,12 +51,13 @@ const CardProgress = ({
</div>

<div
className={`shadow-xs hover:shadow-md p-2 border rounded-xl ${percent <= 50
? 'border-purple bg-purple'
: percent > 50 && percent <= 75
className={`shadow-xs hover:shadow-md p-2 border rounded-xl ${
percent <= 50
? 'border-purple bg-purple'
: percent > 50 && percent <= 75
? 'border-[#FF4500] bg-[#FF4500]'
: 'border-[#2ABB52] bg-[#2ABB52]'
} opacity-80`}
} opacity-80`}
>
<HiOutlineArrowNarrowRight size={25} className={`text-white`} />
</div>
Expand Down
4 changes: 2 additions & 2 deletions tests/pages/saving/[slug].test.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jest.mock('next/router', () => ({
useRouter: jest.fn().mockReturnValue({
query: {
'payment-intent': 'pi_1J4JrjGswQjYFZwX0Z1Z1Z1Z',
'slug': 'test-slug',
slug: 'test-slug',
},
}),
}));
Expand All @@ -17,7 +17,7 @@ describe('Saving', () => {
const { container } = render(
<SessionProvider session={{ user: { data: { access_token: {} } } }}>
<TransactionContext.Provider
value={{ transaction: {}, setTransaction: () => { } }}
value={{ transaction: {}, setTransaction: () => {} }}
>
<SavingSlug />
</TransactionContext.Provider>
Expand Down

1 comment on commit 66ba79e

@vercel
Copy link

@vercel vercel bot commented on 66ba79e Sep 24, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wii-qare-fe – ./

wii-qare-fe-wiiqare.vercel.app
wii-qare-fe-git-main-wiiqare.vercel.app
wii-qare-fe.vercel.app

Please sign in to comment.