Skip to content

Commit

Permalink
chore: add logic to disable register button if user doesnt have activ…
Browse files Browse the repository at this point in the history
…e session
  • Loading branch information
rodrigobustamante committed Dec 23, 2023
1 parent 8a30475 commit 4c259d8
Show file tree
Hide file tree
Showing 9 changed files with 36 additions and 29 deletions.
40 changes: 20 additions & 20 deletions app/(transition)/(root)/events/[id]/fixture.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,126 +37,126 @@ const location = {

const organizers = [
{
id: "1",
name: "Pillippa",
lastname: "",
email: "[email protected]",
image: "string",
},
{
id: "2",
name: "Felipe",
lastname: "Torres",
email: "[email protected]",
image: "string",
},
{
id: "3",
name: "Rod",
lastname: "Bustamante",
email: "[email protected]",
image: "string",
},
{
id: "4",
name: "Claudio",
lastname: "Mágico",
email: "[email protected]",
image: "string",
},
];

const attendees = [
{
id: "1",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "2",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "3",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "4",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "5",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "6",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "7",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "8",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "9",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "10",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "11",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "12",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "13",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "14",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "15",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
{
id: "16",
name: "Katherine",
lastname: "Zboncak",
email: "[email protected]",
image: "",
},
];
Expand Down
1 change: 1 addition & 0 deletions src/api/gql/graphql.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* eslint-disable */
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
/* prettier-ignore */
/* This file is automatically generated. Please do not modify it manually. */
Expand Down
4 changes: 2 additions & 2 deletions src/components/Auth/clerk.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"use client";
import { ClerkProvider } from "@clerk/clerk-react";
import { ClerkProvider } from "@clerk/nextjs";
import React from "react";

type Props = {
Expand All @@ -19,7 +19,7 @@ export const Clerk = ({ children }: Props) => {
const splitted = url.host.split(".");
return [splitted.at(-2), splitted.at(-1)].join(".");
}}
publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY!}
publishableKey={process.env.NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY || ''}
>
{children}
</ClerkProvider>
Expand Down
4 changes: 2 additions & 2 deletions src/components/Event/Attendees/Attendees.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const Attendees: FC<AttendeesTypes> = ({ title, attendees }) => {
{title}
</h2>
<ol className="flex flex-wrap">
{attendees?.map(({ email }) => (
<li className="text-slate-50 dark:text-slate-900" key={email}>
{attendees?.map(({ id }) => (
<li className="text-slate-50 dark:text-slate-900" key={id}>
<UserCircleIcon className="h-7 w-7 shrink-0" />
</li>
))}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Event/Attendees/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type Attendee = {
id: string;
name: string;
lastname: string;
email: string;
image: string;
};

Expand Down
4 changes: 2 additions & 2 deletions src/components/Event/Organizers/Organizers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ export const Organizers: FC<OrganizersTypes> = ({ title, organizers }) => {
{title}
</h2>
<ol className="flex flex-col gap-4">
{organizers?.map(({ name, lastname, email }) => (
<li key={email}>
{organizers?.map(({ id, name, lastname }) => (
<li key={id}>
<span className="flex gap-2 text-slate-50 dark:text-slate-900">
<UserCircleIcon className="h-7 w-7 shrink-0" />
{`${name} ${lastname}`}
Expand Down
2 changes: 1 addition & 1 deletion src/components/Event/Organizers/types.d.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
type Organizer = {
id: string;
name: string;
lastname: string;
email: string;
image: string;
};

Expand Down
7 changes: 6 additions & 1 deletion src/components/Event/Register/Register.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
"use client";

import { Button } from "@/components/ui/button";
import { InformationCircleIcon } from "@heroicons/react/24/outline";
import { useAuth } from "@clerk/clerk-react";

export const Register = () => {
const { isSignedIn } = useAuth();

return (
<section className="flex w-full flex-col gap-4 bg-slate-900 p-6 dark:bg-slate-50">
<h2 className="text-xl text-slate-50 dark:text-slate-900 md:text-4xl">
Expand All @@ -22,7 +27,7 @@ export const Register = () => {
<p className="text-slate-50 dark:text-slate-900">
Para registrarte, por favor haz click en el botón.
</p>
<Button variant={"secondary"} size={"lg"}>
<Button variant={"secondary"} size={"lg"} disabled={!isSignedIn}>
Registrarse
</Button>
</section>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable @typescript-eslint/ban-ts-comment */
// @ts-nocheck
/* eslint-disable */
/* prettier-ignore */
Expand Down

0 comments on commit 4c259d8

Please sign in to comment.