Skip to content

Commit

Permalink
Merge pull request #103 from SJSUCSClub/102-bug-rating-distribution-n…
Browse files Browse the repository at this point in the history
…umbers-are-reversed

[Bug] reverse rating arrays
  • Loading branch information
chrehall68 authored Sep 30, 2024
2 parents 6e399dd + d745113 commit 9a93074
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 7 deletions.
4 changes: 2 additions & 2 deletions app/(main)/compare/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -210,11 +210,11 @@ export default async function Page({
series={[
...(professorStats.map((professor) => ({
name: professor.id,
data: professor.ratingDistribution,
data: professor.ratingDistribution.reverse(),
})) ?? []),
...(courseStats.map((course) => ({
name: course.id,
data: course.ratingDistribution,
data: course.ratingDistribution.reverse(),
})) ?? []),
]}
categories={[5, 4, 3, 2, 1]}
Expand Down
7 changes: 6 additions & 1 deletion app/(main)/courses/[id]/@statistics/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,12 @@ export default async function Page({
<Card className="p-lg max-lg:w-full lg:flex-1">
<p className="pb-sm font-bold">Rating Distribution</p>
<BarChart
series={[{ name: 'Rating Distribution', data: reviewDistribution }]}
series={[
{
name: 'Rating Distribution',
data: reviewDistribution.reverse(),
},
]}
categories={[5, 4, 3, 2, 1]}
/>
</Card>
Expand Down
2 changes: 1 addition & 1 deletion app/(main)/professors/[id]/@statistics/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ export default async function Page({
series={[
{
name: 'Rating Distribution',
data: reviewDistribution,
data: reviewDistribution.reverse(),
},
]}
categories={[5, 4, 3, 2, 1]}
Expand Down
5 changes: 3 additions & 2 deletions components/molecules/client/profile-btn/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import { LinkBtn } from '@/components/atoms';
import { cn } from '@/utils/cn';
import { useSession } from '@/wrappers/session-provider';
import { UserIcon } from '@heroicons/react/20/solid';
import { UserCircleIcon } from '@heroicons/react/24/solid';

interface Props
extends Omit<
Expand All @@ -20,8 +20,9 @@ export const ProfileBtn: React.FC<Props> = ({ className, ...props }) => {
{...props}
href="/profile"
variant="tertiary"
aria-label="Profile"
>
<UserIcon width={20} height={20} /> Profile
<UserCircleIcon width={24} height={24} />{' '}
</LinkBtn>
);
}
Expand Down
2 changes: 1 addition & 1 deletion components/organisms/schedule/component.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Schedule: React.FC<Props> = (props) => (
<LinkBtn
variant="tertiary"
className="rounded-lg p-0 text-inherit"
href={props.link}
href={props.title !== 'TBA' ? props.link : '#'}
>
<Card className="flex w-full flex-col gap-sm max-lg:p-sm lg:p-lg">
<div className="flex max-lg:flex-col max-lg:items-center max-lg:gap-sm max-lg:p-sm lg:items-start lg:justify-between lg:gap-md">
Expand Down

0 comments on commit 9a93074

Please sign in to comment.