Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show number of transfer credits taken in pill #738

Merged
merged 2 commits into from
Feb 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 10 additions & 1 deletion src/components/planner/TransferBank.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { FC, useRef } from 'react';
import { FC, useRef, useState } from 'react';

import ChevronIcon from '@/icons/ChevronIcon';
import useAccordionAnimation from '@/shared/useAccordionAnimation';
Expand Down Expand Up @@ -26,6 +26,15 @@ const TransferBank: FC<TransferBankProps> = ({ transferCredits }) => {
onClick={toggle}
/>
</article>
<div className="mt-2 flex">
<div className="flex items-center gap-x-3 rounded-full bg-primary-100 px-2 py-1">
<span className="whitespace-nowrap text-[11px] font-medium text-primary-500 lg:text-sm">
{/*Assumes the second digit in the second word in each course code is the number of credits it provides*/}
{transferCredits.reduce((acc, curr) => acc + parseInt(curr.split(' ')[1][1]), 0)}{' '}
Credits Taken
</span>
</div>
</div>
<ol
className={`mt-4 flex flex-wrap gap-x-10 gap-y-3 transition-all duration-1000 ease-in-out`}
>
Expand Down
Loading