File tree 3 files changed +29
-5
lines changed
app/(transition)/(root)/events/[id]
3 files changed +29
-5
lines changed Original file line number Diff line number Diff line change
1
+ import { gql } from "@apollo/client" ;
2
+ import { getApolloClient } from "@/api/ApolloClient" ;
1
3
import { MapPinIcon } from "@heroicons/react/24/outline" ;
2
4
import { Attendees } from "@/components/Event/Attendees/Attendees" ;
3
5
import { Hero } from "@/components/Event/Hero/Hero" ;
4
6
import { Information } from "@/components/Event/Information/Information" ;
5
7
import { Location } from "@/components/Event/Location/Location" ;
6
8
import { Organizers } from "@/components/Event/Organizers/Organizers" ;
7
9
import { Register } from "@/components/Event/Register/Register" ;
10
+ import { FetchExampleEventsQuery } from "@/api/gql/graphql" ;
8
11
9
12
// TODO: Mock data, remove after connect this page with GraphQL service
10
13
import { event } from "./fixture" ;
11
14
12
- export default function Event ( ) {
15
+ type Props = {
16
+ searchParams : { [ key : string ] : string | string [ ] | undefined } ;
17
+ } ;
18
+
19
+ export default async function Event ( { searchParams } : Props ) {
20
+ const c = getApolloClient ( ) ;
21
+ const { id } = searchParams ;
22
+
23
+ const response = await c . query < FetchExampleEventsQuery > ( {
24
+ query : gql `
25
+ {
26
+ event(id: "${ id } ") {
27
+ name
28
+ }
29
+ }
30
+ ` ,
31
+ } ) ;
32
+
33
+ console . log ( { response } ) ;
34
+
13
35
const {
14
36
name,
15
37
organizer,
Original file line number Diff line number Diff line change @@ -3,6 +3,8 @@ import Markdown from "react-markdown";
3
3
import remarkGfm from "remark-gfm" ;
4
4
import { InformationTypes } from "./types" ;
5
5
6
+ const remarkPlugins = [ remarkGfm ] ;
7
+
6
8
export const Information : FC < InformationTypes > = ( {
7
9
title,
8
10
information,
@@ -18,7 +20,7 @@ export const Information: FC<InformationTypes> = ({
18
20
</ h2 >
19
21
< Markdown
20
22
className = "prose prose-sm prose-invert !max-w-full dark:prose lg:prose-base"
21
- remarkPlugins = { [ remarkGfm ] }
23
+ remarkPlugins = { remarkPlugins }
22
24
>
23
25
{ information }
24
26
</ Markdown >
Original file line number Diff line number Diff line change @@ -13,9 +13,9 @@ const SheetTrigger = SheetPrimitive.Trigger;
13
13
14
14
const SheetClose = SheetPrimitive . Close ;
15
15
16
- const SheetPortal = ( {
17
- ... props
18
- } : SheetPrimitive . DialogPortalProps ) => < SheetPrimitive . Portal { ... props } /> ;
16
+ const SheetPortal = ( { ... props } : SheetPrimitive . DialogPortalProps ) => (
17
+ < SheetPrimitive . Portal { ... props } />
18
+ ) ;
19
19
SheetPortal . displayName = SheetPrimitive . Portal . displayName ;
20
20
21
21
const SheetOverlay = React . forwardRef <
You can’t perform that action at this time.
0 commit comments