Skip to content

Commit f01d9c0

Browse files
authored
fix #263: address ESlint issues for groupCard component (#617)
1 parent 2e904f9 commit f01d9c0

File tree

2 files changed

+22
-5
lines changed

2 files changed

+22
-5
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ components/Button/button.tsx
3535
components/Calendar/calendar.tsx
3636
components/GiftDetailsView/GiftDetailsView.tsx
3737
components/GiftSuggestionCard/GiftSuggestionCard.tsx
38-
components/GroupCard/GroupCard.tsx
3938
components/ImageSelector/ImageSelector.tsx
4039
components/Input/input.tsx
4140
components/InviteCard/InviteCard.tsx

components/GroupCard/GroupCard.tsx

Lines changed: 22 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,23 @@
1+
// Copyright (c) Gridiron Survivor.
2+
// Licensed under the MIT License.
3+
4+
import { JSX } from 'react';
15
import { GiftExchangeWithMemberCount } from '@/app/types/giftExchange';
26
import { formatDate } from '@/lib/utils';
37
import { ChevronRight, Users } from 'lucide-react';
48
import Link from 'next/link';
9+
import Image from 'next/image';
510

611
type GroupCardProps = {
712
giftExchange: GiftExchangeWithMemberCount;
813
};
914

10-
export const GroupCardSkeleton = () => {
15+
/**
16+
* GroupCardSkeleton component.
17+
* Displays a loading skeleton placeholder for a GroupCard.
18+
* @returns {JSX.Element} Loader skeleton element.
19+
*/
20+
export const GroupCardSkeleton = (): JSX.Element => {
1121
return (
1222
<div className="h-28 flex items-center p-4 rounded-xl bg-groupCardGreen animate-pulse">
1323
<div className="h-16 w-16 lg:h-20 lg:w-20 rounded-xl bg-gray-600" />
@@ -26,14 +36,22 @@ export const GroupCardSkeleton = () => {
2636
);
2737
};
2838

29-
const GroupCard = ({ giftExchange }: GroupCardProps) => {
39+
/**
40+
* GroupCard component. Renders a styled card that displays
41+
* various information about a gift exchange group.
42+
* @param {GiftExchangeWithMemberCount} giftExchange - A unique gift exchange.
43+
* @returns {JSX.Element} A group card element.
44+
*/
45+
const GroupCard = ({ giftExchange }: GroupCardProps): JSX.Element => {
3046
return (
3147
<Link href={`/gift-exchanges/${giftExchange.gift_exchange_id}`}>
3248
<div className="h-28 flex items-center p-4 rounded-xl bg-groupCardGreen">
33-
<img
49+
<Image
3450
className="h-16 w-16 lg:h-20 lg:w-20 rounded-xl"
3551
src={giftExchange.group_image}
36-
alt={`${giftExchange.name} image`}
52+
height={80}
53+
width={80}
54+
alt=""
3755
/>
3856
<div className="flex flex-col flex-grow justify-center h-full ml-4 gap-2">
3957
<h2 className="font-semibold text-white text-base lg:text-lg">

0 commit comments

Comments
 (0)