Skip to content

Commit 21b16e2

Browse files
authored
Merge pull request #388 from LetsGetTechnical/develop
Release 050525
2 parents 4f77740 + 6f5c0f7 commit 21b16e2

File tree

32 files changed

+16470
-4487
lines changed

32 files changed

+16470
-4487
lines changed

.eslintignore

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,10 @@ app/types/giftExchangeMember.ts
3232
app/types/giftSuggestion.ts
3333
app/types/profile.ts
3434
app/types/tailwindcss-motion.d.ts
35-
components/AlertDialogue/AlertDialgoue.tsx
3635
components/Avatar/Avatar.tsx
37-
components/Avatar/AvatarFallback.tsx
3836
components/Avatar/AvatarBody.tsx
3937
components/Button/button.tsx
4038
components/Calendar/calendar.tsx
41-
components/Command/command.tsx
42-
components/FeedbackView/FeedbackView.tsx
43-
components/Form/form.tsx
4439
components/GiftDetailsView/GiftDetailsView.tsx
4540
components/GiftExchangeHeader/GiftExchangeHeader.tsx
4641
components/GiftSuggestionCard/GiftSuggestionCard.tsx
@@ -55,22 +50,15 @@ components/Label/label.tsx
5550
components/LoadingCard/LoadingCard.tsx
5651
components/LoadingSkeleton/LoadingSkeleton.tsx
5752
components/LoadingSpinner/LoadingSpinner.tsx
58-
components/LoginButton/LoginButton.tsx
5953
components/MembersList/MembersList.tsx
6054
components/MultiSelect/multi-select-input.tsx
61-
components/NavLogo/NavLogo.tsx
6255
components/Popover/popover.tsx
6356
components/ProfileCard/ProfileCard.tsx
6457
components/Progress/progress.tsx
65-
components/RadioGroup/radio-group.tsx
6658
components/Select/select.tsx
6759
components/Skeleton/Skeleton.tsx
68-
components/Slider/slider.tsx
6960
components/SnowOverlayToggle/SnowOverlayToggle.tsx
7061
components/SnowOverlayWrapper/react-snow-overlay.d.ts
71-
components/SnowOverlayWrapper/SnowOverlayWrapper.tsx
72-
components/TextArea/textarea.tsx
73-
components/WarningModal/WarningModal.tsx
7462
lib/drawGiftExchange.ts
7563
lib/generateAndStoreSuggestion.ts
7664
lib/generateAndUpdateNewGiftSuggestion.ts

.eslintrc.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,12 +120,7 @@
120120
}
121121
],
122122
"no-extra-semi": "off",
123-
"no-unused-vars": [
124-
"error",
125-
{
126-
"args": "all"
127-
}
128-
],
123+
"no-unused-vars": "off",
129124
"no-unused-expressions": "off",
130125
"semi": "off",
131126
"import/extensions": 0,
@@ -184,7 +179,8 @@
184179
"jsdoc/require-property-type": 0,
185180
"jsdoc/no-types": 0,
186181
"jsdoc/valid-types": 2,
187-
"@typescript-eslint/explicit-function-return-type": "error"
182+
"@typescript-eslint/explicit-function-return-type": "error",
183+
"@typescript-eslint/no-unused-vars": "error"
188184
},
189185
"overrides": [
190186
{

app/create-group-page/page.tsx

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ import {
3535
import { Textarea } from '@/components/TextArea/textarea';
3636
import { ImageSelector } from '@/components/ImageSelector/ImageSelector';
3737
import { useRouter } from 'next/navigation';
38-
import Link from 'next/link';
38+
import LinkCustom from '@/components/LinkCustom/LinkCustom';
3939

4040
const priceRanges = [
4141
{ label: '$10 - $20', value: '10-20' },
@@ -105,15 +105,12 @@ export default function CreateGroupPage() {
105105
}
106106
const giftDrawingDate = form.watch('drawing_date');
107107
return (
108-
<div className=" flex justify-center align-center flex-col px-4 md:px-16 lg:px-32 xl:px-52 pt-12">
108+
<div className="create-group-page flex justify-center align-center flex-col px-4 md:px-16 lg:px-32 xl:px-52 pt-12">
109109
<div className="flex flex-row">
110-
<Link
111-
href={'/dashboard'}
112-
className="flex items-center gap-1 text-sm text-primary-foreground m-5"
113-
>
110+
<LinkCustom href="/dashboard">
114111
<ChevronLeft size={16} strokeWidth={2.25} />
115-
<span>Back to Dashboard</span>
116-
</Link>
112+
Back to Dashboard
113+
</LinkCustom>
117114
</div>
118115
<div className="flex items-center justify-center h-full">
119116
<div className="bg-white w-full xl:w-1/2 mb-5 flex justify-center align-center rounded flex-col ">

app/gift-exchanges/[id]/edit/page.tsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ import { useEffect, useState } from 'react';
3939
import Link from 'next/link';
4040
import { createClient } from '@/lib/supabase/client';
4141
import { GiftExchange } from '@/app/types/giftExchange';
42+
import LinkCustom from '@/components/LinkCustom/LinkCustom';
4243

4344
const priceRanges = [
4445
{ label: '$10 - $20', value: '10-20' },
@@ -174,15 +175,12 @@ export default function CreateGroupPage() {
174175

175176
const giftDrawingDate = form.watch('drawing_date');
176177
return (
177-
<div className=" flex justify-center align-center flex-col px-4 md:px-16 lg:px-32 xl:px-52 pt-12">
178+
<div className="edit-group-page flex justify-center align-center flex-col px-4 md:px-16 lg:px-32 xl:px-52 pt-12">
178179
<div className="flex flex-row">
179-
<Link
180-
href={'/dashboard'}
181-
className="flex items-center gap-1 text-sm text-primary-foreground m-5"
182-
>
180+
<LinkCustom href="/dashboard">
183181
<ChevronLeft size={16} strokeWidth={2.25} />
184182
<span>Back to Dashboard</span>
185-
</Link>
183+
</LinkCustom>
186184
</div>
187185
<div className="flex items-center justify-center h-full">
188186
<div className="bg-white w-full xl:w-1/2 mb-5 flex justify-center align-center rounded flex-col ">

app/onboarding/page.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ function Onboarding() {
247247
if (editing) {
248248
router.push('/profile');
249249
} else {
250-
router.push('/dashboard');
250+
window.location.href = '/dashboard';
251251
}
252252
} catch (error) {
253253
console.error('Error updating profile: ', error);

app/profile/page.tsx

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import ProfileCard from '@/components/ProfileCard/ProfileCard';
33
import { useEffect, useState } from 'react';
44
import { Profile } from '@/app/types/profile';
55
import LoadingCard from '@/components/LoadingCard/LoadingCard';
6+
import { ChevronLeft } from 'lucide-react';
7+
import LinkCustom from '@/components/LinkCustom/LinkCustom';
68

79
export default function PersonalProfile() {
810
const [profile, setProfile] = useState<Profile | null>(null);
@@ -35,7 +37,13 @@ export default function PersonalProfile() {
3537
}
3638

3739
return (
38-
<section className="h-svh flex justify-center items-start py-16">
40+
<section className="profile-page h-svh flex flex-col items-center py-16 px-4 md:px-16 lg:px-32 xl:px-52">
41+
<div className="flex flex-row w-full">
42+
<LinkCustom href="/dashboard">
43+
<ChevronLeft size={16} strokeWidth={2.25} />
44+
Back to Dashboard
45+
</LinkCustom>
46+
</div>
3947
<div className="max-w-5xl">
4048
{profile ? (
4149
<ProfileCard profile={profile} showEditButton />

components/AlertDialogue/AlertDialgoue.tsx

Lines changed: 72 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1+
// Copyright (c) Gridiron Survivor.
2+
// Licensed under the MIT License.
3+
14
'use client';
25

3-
import * as React from 'react';
6+
import { HTMLAttributes, JSX, forwardRef, ElementRef, ComponentPropsWithoutRef } from 'react';
47
import * as AlertDialogPrimitive from '@radix-ui/react-alert-dialog';
58

69
import { cn } from '@/lib/utils';
@@ -12,9 +15,15 @@ const AlertDialogTrigger = AlertDialogPrimitive.Trigger;
1215

1316
const AlertDialogPortal = AlertDialogPrimitive.Portal;
1417

15-
const AlertDialogOverlay = React.forwardRef<
16-
React.ElementRef<typeof AlertDialogPrimitive.Overlay>,
17-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
18+
/**
19+
* A custom overlay for use in the AlertDialog Component.
20+
* @param {object} props - Props for the component.
21+
* @param {string} props.className - Additional CSS classes for custom styling.
22+
* @returns {JSX.Element} - The rendered AlertDialogOverlay element.
23+
*/
24+
const AlertDialogOverlay = forwardRef<
25+
ElementRef<typeof AlertDialogPrimitive.Overlay>,
26+
ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Overlay>
1827
>(({ className, ...props }, ref) => (
1928
<AlertDialogPrimitive.Overlay
2029
className={cn(
@@ -27,9 +36,15 @@ const AlertDialogOverlay = React.forwardRef<
2736
));
2837
AlertDialogOverlay.displayName = AlertDialogPrimitive.Overlay.displayName;
2938

30-
const AlertDialogContent = React.forwardRef<
31-
React.ElementRef<typeof AlertDialogPrimitive.Content>,
32-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
39+
/**
40+
* Contains content to be rendered when the AlertDialog component is open.
41+
* @param {object} props - Props for the component.
42+
* @param {string} props.className - Additional CSS classes for custom styling.
43+
* @returns {JSX.Element} - The rendered AlertDialogContent element.
44+
*/
45+
const AlertDialogContent = forwardRef<
46+
ElementRef<typeof AlertDialogPrimitive.Content>,
47+
ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Content>
3348
>(({ className, ...props }, ref) => (
3449
<AlertDialogPortal>
3550
<AlertDialogOverlay />
@@ -45,10 +60,16 @@ const AlertDialogContent = React.forwardRef<
4560
));
4661
AlertDialogContent.displayName = AlertDialogPrimitive.Content.displayName;
4762

63+
/**
64+
* A custom header for use in the AlertDialog Component.
65+
* @param {HTMLAttributes<HTMLDivElement>} props - Props for function.
66+
* @param {string} props.className - Additional CSS classes for custom styling.
67+
* @returns {JSX.Element} - The rendered AlertDialogHeader element.
68+
*/
4869
const AlertDialogHeader = ({
4970
className,
5071
...props
51-
}: React.HTMLAttributes<HTMLDivElement>) => (
72+
}: HTMLAttributes<HTMLDivElement>): JSX.Element => (
5273
<div
5374
className={cn(
5475
'flex flex-col space-y-2 text-center sm:text-left',
@@ -59,10 +80,16 @@ const AlertDialogHeader = ({
5980
);
6081
AlertDialogHeader.displayName = 'AlertDialogHeader';
6182

83+
/**
84+
* A custom footer for use in the AlertDialogFooter Component.
85+
* @param {HTMLAttributes<HTMLDivElement>} props - Props for function.
86+
* @param {string} props.className - Additional CSS classes for custom styling.
87+
* @returns {JSX.Element} - The rendered AlertDialogFooter element.
88+
*/
6289
const AlertDialogFooter = ({
6390
className,
6491
...props
65-
}: React.HTMLAttributes<HTMLDivElement>) => (
92+
}: HTMLAttributes<HTMLDivElement>): JSX.Element => (
6693
<div
6794
className={cn(
6895
'flex flex-col-reverse sm:flex-row sm:justify-end sm:space-x-2',
@@ -73,9 +100,15 @@ const AlertDialogFooter = ({
73100
);
74101
AlertDialogFooter.displayName = 'AlertDialogFooter';
75102

76-
const AlertDialogTitle = React.forwardRef<
77-
React.ElementRef<typeof AlertDialogPrimitive.Title>,
78-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
103+
/**
104+
* An accessible title announced when the AlertDialog component is opened.
105+
* @param {object} props - Props for the component.
106+
* @param {string} props.className - Additional CSS classes for custom styling.
107+
* @returns {JSX.Element} - The rendered AlertDialogTitle element.
108+
*/
109+
const AlertDialogTitle = forwardRef<
110+
ElementRef<typeof AlertDialogPrimitive.Title>,
111+
ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Title>
79112
>(({ className, ...props }, ref) => (
80113
<AlertDialogPrimitive.Title
81114
ref={ref}
@@ -85,9 +118,15 @@ const AlertDialogTitle = React.forwardRef<
85118
));
86119
AlertDialogTitle.displayName = AlertDialogPrimitive.Title.displayName;
87120

88-
const AlertDialogDescription = React.forwardRef<
89-
React.ElementRef<typeof AlertDialogPrimitive.Description>,
90-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
121+
/**
122+
* An accessible description announced when the AlertDialog component is opened.
123+
* @param {object} props - Props for the component.
124+
* @param {string} props.className - Additional CSS classes for custom styling.
125+
* @returns {JSX.Element} - The rendered AlertDialogDescription element.
126+
*/
127+
const AlertDialogDescription = forwardRef<
128+
ElementRef<typeof AlertDialogPrimitive.Description>,
129+
ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Description>
91130
>(({ className, ...props }, ref) => (
92131
<AlertDialogPrimitive.Description
93132
ref={ref}
@@ -98,9 +137,15 @@ const AlertDialogDescription = React.forwardRef<
98137
AlertDialogDescription.displayName =
99138
AlertDialogPrimitive.Description.displayName;
100139

101-
const AlertDialogAction = React.forwardRef<
102-
React.ElementRef<typeof AlertDialogPrimitive.Action>,
103-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
140+
/**
141+
* A button that closes the AlertDialog component. Should be distinguished visually from the Cancel button.
142+
* @param {object} props - Props for the component.
143+
* @param {string} props.className - Additional CSS classes for custom styling.
144+
* @returns {JSX.Element} - The rendered AlertDialogAction element.
145+
*/
146+
const AlertDialogAction = forwardRef<
147+
ElementRef<typeof AlertDialogPrimitive.Action>,
148+
ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Action>
104149
>(({ className, ...props }, ref) => (
105150
<AlertDialogPrimitive.Action
106151
ref={ref}
@@ -110,9 +155,15 @@ const AlertDialogAction = React.forwardRef<
110155
));
111156
AlertDialogAction.displayName = AlertDialogPrimitive.Action.displayName;
112157

113-
const AlertDialogCancel = React.forwardRef<
114-
React.ElementRef<typeof AlertDialogPrimitive.Cancel>,
115-
React.ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
158+
/**
159+
* A button that closes the AlertDialog component. Should be distinguished visually from the Action button.
160+
* @param {object} props - Props for the component.
161+
* @param {string} props.className - Additional CSS classes for custom styling.
162+
* @returns {JSX.Element} - The rendered AlertDialogCancel element.
163+
*/
164+
const AlertDialogCancel = forwardRef<
165+
ElementRef<typeof AlertDialogPrimitive.Cancel>,
166+
ComponentPropsWithoutRef<typeof AlertDialogPrimitive.Cancel>
116167
>(({ className, ...props }, ref) => (
117168
<AlertDialogPrimitive.Cancel
118169
ref={ref}

components/Avatar/Avatar.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,18 @@
1+
// Copyright (c) Gridiron Survivor.
2+
// Licensed under the MIT License.
3+
4+
import { JSX } from 'react';
5+
16
import { AvatarImage } from './AvatarImage';
27
import { AvatarFallback } from './AvatarFallback';
38
import { AvatarBody } from './AvatarBody';
49

5-
const Avatar = ({ userAvatar }: { userAvatar: string | undefined }) => {
10+
/**
11+
* An Avatar component that displays a provided image URL or a default image if not provided.
12+
* @param {string} userAvatar - URL string for the avatar image. If undefined, the AvatarFallback img will be used.
13+
* @returns {JSX.Element} - The rendered Avatar element.
14+
*/
15+
const Avatar = ({ userAvatar }: { userAvatar: string | undefined }) : JSX.Element => {
616
return (
717
<AvatarBody>
818
<AvatarImage src={userAvatar} alt="" />

components/Avatar/AvatarBody.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
// Copyright (c) Gridiron Survivor.
2+
// Licensed under the MIT License.
3+
14
'use client';
25

3-
import React from 'react';
6+
import { JSX, ElementRef, ComponentPropsWithoutRef, forwardRef } from 'react';
47
import * as AvatarPrimitive from '@radix-ui/react-avatar';
58
import { cn } from '@/lib/utils';
69

7-
const AvatarBody = React.forwardRef<
8-
React.ElementRef<typeof AvatarPrimitive.Root>,
9-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
10+
/**
11+
* The AvatarBody component.
12+
* @param {object} props - The props passed.
13+
* @param {string} props.className - Styles for component.
14+
* @returns {JSX.Element} - The AvatarBody component.
15+
*/
16+
const AvatarBody = forwardRef<
17+
ElementRef<typeof AvatarPrimitive.Root>,
18+
ComponentPropsWithoutRef<typeof AvatarPrimitive.Root>
1019
>(({ className, ...props }, ref) => (
1120
<AvatarPrimitive.Root
1221
ref={ref}

components/Avatar/AvatarFallback.tsx

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,21 @@
1+
// Copyright (c) Gridiron Survivor.
2+
// Licensed under the MIT License.
3+
14
'use client';
25

3-
import React from 'react';
6+
import { JSX, ElementRef, ComponentPropsWithoutRef, forwardRef } from 'react';
47
import * as AvatarPrimitive from '@radix-ui/react-avatar';
58
import { cn } from '@/lib/utils';
69

7-
const AvatarFallback = React.forwardRef<
8-
React.ElementRef<typeof AvatarPrimitive.Fallback>,
9-
React.ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
10+
/**
11+
* The AvatarFallback component with a fallback image.
12+
* @param {object} props - The props passed.
13+
* @param {string} props.className - Styles for component.
14+
* @returns {JSX.Element} - The AvatarFallback component.
15+
*/
16+
const AvatarFallback = forwardRef<
17+
ElementRef<typeof AvatarPrimitive.Fallback>,
18+
ComponentPropsWithoutRef<typeof AvatarPrimitive.Fallback>
1019
>(({ className, ...props }, ref) => (
1120
<AvatarPrimitive.Fallback
1221
ref={ref}

0 commit comments

Comments
 (0)