-
-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specific event page #22
Merged
Merged
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
370b2e1
chore: add base file for specific event page
rodrigobustamante d7cfce7
chore: add base file for hero (with texts written on hard)
rodrigobustamante 3ea22ec
chore: add hero types and implement hero tweaks
rodrigobustamante 412bf22
feat: add register component, hero tweaks and prettier fix
rodrigobustamante c76ae75
feat: add location component and implement google maps
rodrigobustamante b53bfbb
feat: add location, organizers, information and attendees components
rodrigobustamante 876657b
chore: move events components to src/components folder
rodrigobustamante 28baf73
chore: override max-width in md component (tailwind typography max-wi…
rodrigobustamante 0df5ece
style: apply prettier on types.d.ts files
rodrigobustamante 98ff698
style: add decs.d.ts and remove classname on sheet component
rodrigobustamante 0688898
style: apply prettier on sheets file
rodrigobustamante 367d22d
chore: add max-width to one event page
rodrigobustamante 4eade11
chore: add apolloClient to one event page
rodrigobustamante 96f0428
feat: implement get event on event page
rodrigobustamante 8a30475
chore: add EventEditInput and @typescript-eslint/ban-ts-comment in co…
rodrigobustamante 4c259d8
chore: add logic to disable register button if user doesnt have activ…
rodrigobustamante 6886fc5
style: prettier applied
rodrigobustamante 57bbdc9
chore: rollback to clerk react
rodrigobustamante File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,4 @@ | ||
NEXT_PUBLIC_JSCL_API_URL='https://api.jsconf.dev/graphql' | ||
NEXT_PUBLIC_TOKEN_STORAGE_KEY='HS:token_storage_key' | ||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY='pk_test_ZnVua3ktZ3JpZmZvbi04NC5jbGVyay5hY2NvdW50cy5kZXYk' | ||
NEXT_PUBLIC_GOOGLE_MAPS_KEY='your_google_maps_key_here' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,3 @@ | ||
{} | ||
{ | ||
"plugins": ["prettier-plugin-tailwindcss"] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,172 @@ | ||
const information = ` | ||
# TechCon 2023: Innovación y Futuro | ||
|
||
## Descripción del Evento | ||
|
||
Bienvenidos a TechCon 2023, el evento anual líder donde la innovación, la tecnología y las ideas del futuro se encuentran. Durante tres días emocionantes, del 10 al 12 de septiembre, nos sumergiremos en el mundo de las últimas tendencias y desarrollos en el ámbito tecnológico. | ||
Con la presencia de expertos reconocidos a nivel mundial, TechCon 2023 será el lugar perfecto para expandir tus conocimientos, conectar con profesionales de la industria y descubrir las tecnologías que están dando forma a nuestro futuro. | ||
|
||
|
||
## Ponentes Destacados | ||
|
||
- **Dr. Ana Martínez**: Pionera en inteligencia artificial y aprendizaje automático. Con más de 20 años de experiencia, la Dra. Martínez compartirá su visión sobre cómo la IA está transformando los negocios y la sociedad. | ||
- **Carlos Hernández**: Experto en ciberseguridad y tecnologías blockchain. Carlos discutirá las últimas tendencias en seguridad digital y cómo la blockchain está revolucionando la forma en que pensamos sobre la privacidad y las transacciones online. | ||
- **Sarah Lee**: Innovadora en el campo de la realidad aumentada y virtual. Sarah nos llevará a través de un viaje por las aplicaciones prácticas de AR y VR en educación y entretenimiento. | ||
|
||
|
||
## Talleres y Sesiones Interactivas | ||
|
||
Participa en una variedad de talleres prácticos y sesiones interactivas dirigidas por líderes de la industria. Algunos de los temas incluyen: | ||
Desarrollo de aplicaciones con React y TypeScript: Aprende las mejores prácticas y técnicas avanzadas de manos de desarrolladores experimentados. | ||
Automatización con Python y FastAPI: Descubre cómo simplificar tus flujos de trabajo y mejorar la eficiencia en tus proyectos. | ||
Tecnologías emergentes en Cloud Computing: Explora las últimas innovaciones y soluciones en la nube. | ||
|
||
## Networking y Exposición | ||
|
||
TechCon 2023 también ofrece amplias oportunidades para networking. Conéctate con otros profesionales, encuentra posibles colaboradores y descubre nuevas oportunidades de carrera en nuestra feria de exposiciones, donde empresas líderes en tecnología presentarán sus productos y servicios más recientes. | ||
|
||
## Registro e Información Adicional | ||
|
||
¡No te pierdas esta oportunidad única de estar a la vanguardia de la tecnología! Para más información y para registrarte, visita nuestro sitio web: www.techcon2023.com. | ||
`; | ||
|
||
const location = { | ||
address: 'Los Jesuitas 881, 7501300 Providencia, Región Metropolitana', | ||
information: 'Más descripción de como llegar al evento. Tocar la puerta X, subir por las escaleras de la derecha, etc.' | ||
} | ||
|
||
const organizers = [ | ||
{ | ||
id: "1", | ||
name: "Pillippa", | ||
lastname: "", | ||
image: "string", | ||
}, | ||
{ | ||
id: "2", | ||
name: "Felipe", | ||
lastname: "Torres", | ||
image: "string", | ||
}, | ||
{ | ||
id: "3", | ||
name: "Rod", | ||
lastname: "Bustamante", | ||
image: "string", | ||
}, | ||
{ | ||
id: "4", | ||
name: "Claudio", | ||
lastname: "Mágico", | ||
image: "string", | ||
}, | ||
]; | ||
|
||
const attendees = [ | ||
{ | ||
id: "1", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "2", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "3", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "4", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "5", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "6", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "7", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "8", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "9", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "10", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "11", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "12", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "13", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "14", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "15", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
{ | ||
id: "16", | ||
name: "Katherine", | ||
lastname: "Zboncak", | ||
image: "", | ||
}, | ||
]; | ||
|
||
export const event = { | ||
name: "Javascript Meetup — Enero", | ||
organizer: "Javascript Chile", | ||
datetime: "Jueves, 27 Enero, 2024 | 6:30 PM", | ||
location, | ||
information, | ||
organizers, | ||
attendees, | ||
}; |
72 changes: 72 additions & 0 deletions
72
app/(transition)/(root)/events/[id]/getEvent.generated.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
/* eslint-disable @typescript-eslint/ban-ts-comment */ | ||
// @ts-nocheck | ||
/* eslint-disable */ | ||
/* prettier-ignore */ | ||
/* This file is automatically generated. Please do not modify it manually. */ | ||
import * as Types from '../../../../../src/api/gql/graphql'; | ||
|
||
import { gql } from '@apollo/client'; | ||
import * as Apollo from '@apollo/client'; | ||
import * as ApolloReactHooks from '@apollo/experimental-nextjs-app-support/ssr'; | ||
const defaultOptions = {} as const; | ||
export type GetEventQueryVariables = Types.Exact<{ | ||
input: Types.Scalars['String']['input']; | ||
}>; | ||
|
||
|
||
export type GetEventQuery = { __typename?: 'Query', event?: { __typename?: 'Event', name: string, address?: string | null, description?: string | null, maxAttendees?: number | null, startDateTime: any, status: Types.EventStatus, community?: { __typename?: 'Community', name?: string | null } | null, users: Array<{ __typename?: 'User', id: string, name?: string | null, lastName?: string | null }> } | null }; | ||
|
||
|
||
export const GetEventDocument = gql` | ||
query getEvent($input: String!) { | ||
event(id: $input) { | ||
name | ||
address | ||
description | ||
maxAttendees | ||
startDateTime | ||
status | ||
community { | ||
name | ||
} | ||
users { | ||
id | ||
name | ||
lastName | ||
} | ||
} | ||
} | ||
`; | ||
|
||
/** | ||
* __useGetEventQuery__ | ||
* | ||
* To run a query within a React component, call `useGetEventQuery` and pass it any options that fit your needs. | ||
* When your component renders, `useGetEventQuery` returns an object from Apollo Client that contains loading, error, and data properties | ||
* you can use to render your UI. | ||
* | ||
* @param baseOptions options that will be passed into the query, supported options are listed on: https://www.apollographql.com/docs/react/api/react-hooks/#options; | ||
* | ||
* @example | ||
* const { data, loading, error } = useGetEventQuery({ | ||
* variables: { | ||
* input: // value for 'input' | ||
* }, | ||
* }); | ||
*/ | ||
export function useGetEventQuery(baseOptions: ApolloReactHooks.QueryHookOptions<GetEventQuery, GetEventQueryVariables>) { | ||
const options = {...defaultOptions, ...baseOptions} | ||
return ApolloReactHooks.useQuery<GetEventQuery, GetEventQueryVariables>(GetEventDocument, options); | ||
} | ||
export function useGetEventLazyQuery(baseOptions?: ApolloReactHooks.LazyQueryHookOptions<GetEventQuery, GetEventQueryVariables>) { | ||
const options = {...defaultOptions, ...baseOptions} | ||
return ApolloReactHooks.useLazyQuery<GetEventQuery, GetEventQueryVariables>(GetEventDocument, options); | ||
} | ||
export function useGetEventSuspenseQuery(baseOptions?: ApolloReactHooks.SuspenseQueryHookOptions<GetEventQuery, GetEventQueryVariables>) { | ||
const options = {...defaultOptions, ...baseOptions} | ||
return ApolloReactHooks.useSuspenseQuery<GetEventQuery, GetEventQueryVariables>(GetEventDocument, options); | ||
} | ||
export type GetEventQueryHookResult = ReturnType<typeof useGetEventQuery>; | ||
export type GetEventLazyQueryHookResult = ReturnType<typeof useGetEventLazyQuery>; | ||
export type GetEventSuspenseQueryHookResult = ReturnType<typeof useGetEventSuspenseQuery>; | ||
export type GetEventQueryResult = Apollo.QueryResult<GetEventQuery, GetEventQueryVariables>; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
query getEvent($input: String!) { | ||
event(id: $input) { | ||
name | ||
address | ||
description | ||
maxAttendees | ||
startDateTime | ||
status | ||
community { | ||
name | ||
} | ||
users { | ||
id | ||
name | ||
lastName | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,88 @@ | ||
import { gql } from "@apollo/client"; | ||
import { getApolloClient } from "@/api/ApolloClient"; | ||
import { MapPinIcon } from "@heroicons/react/24/outline"; | ||
import { Attendees } from "@/components/Event/Attendees/Attendees"; | ||
import { Hero } from "@/components/Event/Hero/Hero"; | ||
import { Information } from "@/components/Event/Information/Information"; | ||
import { Location } from "@/components/Event/Location/Location"; | ||
import { Organizers } from "@/components/Event/Organizers/Organizers"; | ||
import { Register } from "@/components/Event/Register/Register"; | ||
import { EventType, PageProps } from "./types"; | ||
import { GetEventDocument } from "./getEvent.generated"; | ||
|
||
export default async function Event({ searchParams }: PageProps) { | ||
const c = getApolloClient(); | ||
const { id } = searchParams; | ||
|
||
const { data, error } = await c.query<EventType>({ | ||
query: GetEventDocument, | ||
variables: { | ||
input: id | ||
} | ||
}); | ||
|
||
if (error) return <h2>Ocurrió un error cargando el evento</h2>; | ||
|
||
const { event } = data; | ||
|
||
if (!event) return <h2>No pudimos encontrar el evento que estás buscando</h2>; | ||
|
||
const { | ||
address, | ||
community, | ||
description, | ||
name, | ||
startDateTime, | ||
users, | ||
} = event; | ||
|
||
const eventDate = new Date(startDateTime).toLocaleString(); | ||
|
||
return ( | ||
<main className="flex w-full max-w-[1360px] flex-col items-center justify-between gap-6 px-6 py-7 transition-all md:px-10 lg:grid lg:grid-cols-5 lg:items-start lg:gap-8 lg:px-24 lg:pt-14 xl:grid-cols-6 xl:px-16"> | ||
<div className="order-1 w-full lg:col-span-5 xl:col-span-4"> | ||
<Hero> | ||
<div className="mr-auto flex w-full flex-col place-self-center"> | ||
<h1 className="mb-4 max-w-2xl text-xl font-extrabold leading-none tracking-tight dark:text-white md:text-4xl"> | ||
{name} | ||
</h1> | ||
<div className="flex w-full justify-between"> | ||
<div className="flex grow flex-col"> | ||
<p className="font-thin"> | ||
por <span className="underline">{community?.name}</span> | ||
</p> | ||
<p className="font-thin">{eventDate}</p> | ||
</div> | ||
<div className="hidden md:flex md:max-w-xs md:items-center md:gap-2"> | ||
<MapPinIcon className="h-8 w-8" /> | ||
<p className="font-thin">{address}</p> | ||
</div> | ||
</div> | ||
</div> | ||
</Hero> | ||
<Register /> | ||
</div> | ||
<div className="order-2 lg:order-4 lg:col-span-3 xl:order-3 xl:col-span-4"> | ||
<Information title="El evento" information={description} /> | ||
</div> | ||
<div className="order-3 lg:order-2 lg:col-span-3 xl:col-span-2 xl:h-full"> | ||
<Location | ||
title="Lugar" | ||
location={{ | ||
address: "Calle falsa 123", | ||
information: null, | ||
}} | ||
/> | ||
</div> | ||
<div className="order-4 flex w-full flex-col gap-6 lg:order-3 lg:col-span-2"> | ||
<Organizers title="Organizadores" organizers={[]} /> | ||
<Attendees | ||
title={`Asistentes (${users?.length || 0})`} | ||
attendees={users} | ||
/> | ||
</div> | ||
</main> | ||
); | ||
} | ||
|
||
export const runtime = "edge"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
type Community = { | ||
name: string; | ||
} | ||
|
||
type EventClass = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Para estos tipos deberiamos usar los de There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. (Nos ahorramos que diverjan en lo que cambie la API) |
||
name: string; | ||
address: null; | ||
description: string; | ||
maxAttendees: number; | ||
status: string; | ||
startDateTime: Date; | ||
meetingURL: null; | ||
community: Community; | ||
tags: any[]; | ||
users: any[]; | ||
tickets: any[]; | ||
} | ||
|
||
type Data = { | ||
event: EventClass; | ||
} | ||
|
||
export type EventType = { | ||
event: EventClass; | ||
} | ||
|
||
export type PageProps = { | ||
searchParams: { [key: string]: string | string[] | undefined }; | ||
}; | ||
|
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
en el futuro, deberiamos usar
faker
para los fixturesEn este caso. es
fixture
un nombre protegido de esta carpeta? onda podemos crear este archivo aca (dentro de/app
digo?)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No entendí muy bien la pregunta 😢