Skip to content
Open
Show file tree
Hide file tree
Changes from 4 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
9 changes: 3 additions & 6 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
# Ignored files due to ESLINT errors

**/*.test.ts
**/*.test.tsx
**/*.test.js
**/*.test.jsx
**/\*.test.ts
**/_.test.tsx
\*\*/_.test.js \*_/_.test.jsx
app/api/gift-exchanges/route.ts
app/api/gift-exchanges/\[id\]/draw/route.ts
app/api/gift-exchanges/\[id\]/giftSuggestions/route.ts
Expand Down Expand Up @@ -36,14 +35,12 @@ components/Avatar/Avatar.tsx
components/Avatar/AvatarBody.tsx
components/Button/button.tsx
components/Calendar/calendar.tsx
components/GiftDetailsView/GiftDetailsView.tsx
components/GiftExchangeHeader/GiftExchangeHeader.tsx
components/GiftSuggestionCard/GiftSuggestionCard.tsx
components/GlobalGiftSpinner/GlobalGiftSpinner.tsx
components/GlobalHeader/GlobalHeader.tsx
components/GroupCard/GroupCard.tsx
components/ImageSelector/ImageSelector.tsx
components/Input/input.tsx
components/InviteCard/InviteCard.tsx
components/JourneyCard/JourneyCard.tsx
components/Label/label.tsx
Expand Down
19 changes: 17 additions & 2 deletions components/GiftDetailsView/GiftDetailsView.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import { Button } from '../Button/button';
import {
CardContent,
Expand All @@ -9,21 +12,33 @@ import {
import { SquareArrowOutUpRight, ThumbsDown, Gift } from 'lucide-react';
import { GiftSuggestion } from '@/app/types/giftSuggestion';
import { useState, useCallback } from 'react';
import { JSX } from 'react';

/**
* A GiftDetailsView compoennt
* @param {GiftSuggestion} gift - Gift suggestion being passed
* @param {Function} handleFeedback - callback function when feedback is provided
* @returns {JSX.Element} - The rendered GiftDetailsView element.
*/
const GiftDetailsView = ({
gift,
handleFeedback,
}: {
gift: GiftSuggestion;
handleFeedback: () => void;
}) => {
}): JSX.Element => {
const [imageError, setImageError] = useState(false);

const handleImageError = useCallback(() => {
setImageError(true);
}, []);

const handleAmazonLink = ({ searchTerm }: { searchTerm: string }) => {
/**
* Search Term details
* @param {string} searchTerm - search term being passed in to search amazon list
* @returns {string} - returns an encoded search string with the search term
*/
const handleAmazonLink = ({ searchTerm }: { searchTerm: string }): string => {
const encodedSearch = encodeURIComponent(searchTerm).replace(/%20/g, '+');
return `https://www.amazon.com/s?k=${encodedSearch}`;
};
Expand Down
5 changes: 4 additions & 1 deletion components/Input/input.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import * as React from 'react';
// Copyright (c) Gridiron Survivor.
// Licensed under the MIT License.

import * as React from 'react';
Comment thread
luisarevalo21 marked this conversation as resolved.
Outdated
import { cn } from '@/lib/utils';

const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
Comment thread
luisarevalo21 marked this conversation as resolved.
Outdated
Expand All @@ -18,6 +20,7 @@ const Input = React.forwardRef<HTMLInputElement, React.ComponentProps<'input'>>(
);
},
);

Input.displayName = 'Input';

export { Input };