Skip to content

Commit 4c259d8

Browse files
chore: add logic to disable register button if user doesnt have active session
1 parent 8a30475 commit 4c259d8

File tree

9 files changed

+36
-29
lines changed

9 files changed

+36
-29
lines changed

Diff for: app/(transition)/(root)/events/[id]/fixture.ts

+20-20
Original file line numberDiff line numberDiff line change
@@ -37,126 +37,126 @@ const location = {
3737

3838
const organizers = [
3939
{
40+
id: "1",
4041
name: "Pillippa",
4142
lastname: "",
42-
4343
image: "string",
4444
},
4545
{
46+
id: "2",
4647
name: "Felipe",
4748
lastname: "Torres",
48-
4949
image: "string",
5050
},
5151
{
52+
id: "3",
5253
name: "Rod",
5354
lastname: "Bustamante",
54-
5555
image: "string",
5656
},
5757
{
58+
id: "4",
5859
name: "Claudio",
5960
lastname: "Mágico",
60-
6161
image: "string",
6262
},
6363
];
6464

6565
const attendees = [
6666
{
67+
id: "1",
6768
name: "Katherine",
6869
lastname: "Zboncak",
69-
7070
image: "",
7171
},
7272
{
73+
id: "2",
7374
name: "Katherine",
7475
lastname: "Zboncak",
75-
7676
image: "",
7777
},
7878
{
79+
id: "3",
7980
name: "Katherine",
8081
lastname: "Zboncak",
81-
8282
image: "",
8383
},
8484
{
85+
id: "4",
8586
name: "Katherine",
8687
lastname: "Zboncak",
87-
8888
image: "",
8989
},
9090
{
91+
id: "5",
9192
name: "Katherine",
9293
lastname: "Zboncak",
93-
9494
image: "",
9595
},
9696
{
97+
id: "6",
9798
name: "Katherine",
9899
lastname: "Zboncak",
99-
100100
image: "",
101101
},
102102
{
103+
id: "7",
103104
name: "Katherine",
104105
lastname: "Zboncak",
105-
106106
image: "",
107107
},
108108
{
109+
id: "8",
109110
name: "Katherine",
110111
lastname: "Zboncak",
111-
112112
image: "",
113113
},
114114
{
115+
id: "9",
115116
name: "Katherine",
116117
lastname: "Zboncak",
117-
118118
image: "",
119119
},
120120
{
121+
id: "10",
121122
name: "Katherine",
122123
lastname: "Zboncak",
123-
124124
image: "",
125125
},
126126
{
127+
id: "11",
127128
name: "Katherine",
128129
lastname: "Zboncak",
129-
130130
image: "",
131131
},
132132
{
133+
id: "12",
133134
name: "Katherine",
134135
lastname: "Zboncak",
135-
136136
image: "",
137137
},
138138
{
139+
id: "13",
139140
name: "Katherine",
140141
lastname: "Zboncak",
141-
142142
image: "",
143143
},
144144
{
145+
id: "14",
145146
name: "Katherine",
146147
lastname: "Zboncak",
147-
148148
image: "",
149149
},
150150
{
151+
id: "15",
151152
name: "Katherine",
152153
lastname: "Zboncak",
153-
154154
image: "",
155155
},
156156
{
157+
id: "16",
157158
name: "Katherine",
158159
lastname: "Zboncak",
159-
160160
image: "",
161161
},
162162
];

Diff for: src/api/gql/graphql.ts

+1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
/* eslint-disable */
2+
/* eslint-disable @typescript-eslint/ban-ts-comment */
23
// @ts-nocheck
34
/* prettier-ignore */
45
/* This file is automatically generated. Please do not modify it manually. */

Diff for: src/components/Auth/clerk.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"use client";
2-
import { ClerkProvider } from "@clerk/clerk-react";
2+
import { ClerkProvider } from "@clerk/nextjs";
33
import React from "react";
44

55
type Props = {
@@ -19,7 +19,7 @@ export const Clerk = ({ children }: Props) => {
1919
const splitted = url.host.split(".");
2020
return [splitted.at(-2), splitted.at(-1)].join(".");
2121
}}
22-
publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY!}
22+
publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY || ''}
2323
>
2424
{children}
2525
</ClerkProvider>

Diff for: src/components/Event/Attendees/Attendees.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const Attendees: FC<AttendeesTypes> = ({ title, attendees }) => {
1111
{title}
1212
</h2>
1313
<ol className="flex flex-wrap">
14-
{attendees?.map(({ email }) => (
15-
<li className="text-slate-50 dark:text-slate-900" key={email}>
14+
{attendees?.map(({ id }) => (
15+
<li className="text-slate-50 dark:text-slate-900" key={id}>
1616
<UserCircleIcon className="h-7 w-7 shrink-0" />
1717
</li>
1818
))}

Diff for: src/components/Event/Attendees/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type Attendee = {
2+
id: string;
23
name: string;
34
lastname: string;
4-
email: string;
55
image: string;
66
};
77

Diff for: src/components/Event/Organizers/Organizers.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ export const Organizers: FC<OrganizersTypes> = ({ title, organizers }) => {
1111
{title}
1212
</h2>
1313
<ol className="flex flex-col gap-4">
14-
{organizers?.map(({ name, lastname, email }) => (
15-
<li key={email}>
14+
{organizers?.map(({ id, name, lastname }) => (
15+
<li key={id}>
1616
<span className="flex gap-2 text-slate-50 dark:text-slate-900">
1717
<UserCircleIcon className="h-7 w-7 shrink-0" />
1818
{`${name} ${lastname}`}

Diff for: src/components/Event/Organizers/types.d.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
type Organizer = {
2+
id: string;
23
name: string;
34
lastname: string;
4-
email: string;
55
image: string;
66
};
77

Diff for: src/components/Event/Register/Register.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
1+
"use client";
2+
13
import { Button } from "@/components/ui/button";
24
import { InformationCircleIcon } from "@heroicons/react/24/outline";
5+
import { useAuth } from "@clerk/clerk-react";
36

47
export const Register = () => {
8+
const { isSignedIn } = useAuth();
9+
510
return (
611
<section className="flex w-full flex-col gap-4 bg-slate-900 p-6 dark:bg-slate-50">
712
<h2 className="text-xl text-slate-50 dark:text-slate-900 md:text-4xl">
@@ -22,7 +27,7 @@ export const Register = () => {
2227
<p className="text-slate-50 dark:text-slate-900">
2328
Para registrarte, por favor haz click en el botón.
2429
</p>
25-
<Button variant={"secondary"} size={"lg"}>
30+
<Button variant={"secondary"} size={"lg"} disabled={!isSignedIn}>
2631
Registrarse
2732
</Button>
2833
</section>

Diff for: src/components/features/LandingPageEvents/graphql/FetchExampleEvents.generated.tsx

+1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable @typescript-eslint/ban-ts-comment */
12
// @ts-nocheck
23
/* eslint-disable */
34
/* prettier-ignore */

0 commit comments

Comments
 (0)