Skip to content

Commit

Permalink
Merge pull request #738 from UTDNebula/transfer-num-credits
Browse files Browse the repository at this point in the history
Show number of transfer credits taken in pill
  • Loading branch information
jasonappah authored Feb 13, 2024
2 parents 828c489 + b3fa28a commit 107aed6
Showing 1 changed file with 10 additions and 1 deletion.
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

0 comments on commit 107aed6

Please sign in to comment.