- {data()?.repository.issue.title}
+ {issueData()?.repository.issue.title}
- {issueData()?.['event-description'].text}
+ {issueData()?.parsedBody['event-description'].text}
diff --git a/src/routes/events/index.jsx b/src/routes/events/index.jsx
new file mode 100644
index 0000000..4e69bbb
--- /dev/null
+++ b/src/routes/events/index.jsx
@@ -0,0 +1,79 @@
+import upcomingEventsQuery from '~/graphql/upcoming-events.query.js'
+// import pastEventsQuery from '~/graphql/past-events.query.js'
+import graphql from '~/server/graphql.js'
+import { For, Show, Suspense, createResource } from 'solid-js'
+import { SimpleLayout } from '~/components/SimpleLayout'
+import { createAsync, cache } from '@solidjs/router'
+import bodyParser from '@zentered/issue-forms-body-parser'
+import { Card } from '~/components/Card'
+import { formatDate } from '~/lib/formatDate'
+
+function EventLine(props) {
+ const [issueData] = createResource(async () => {
+ return bodyParser(props.event.body)
+ })
+
+ return (
+
+
+
+
+ {props.event.title}
+
+
+ {issueData()?.['event-description'].text}
+
+ Event Details
+
+
+ {formatDate(issueData()?.date.date)}
+
+
+
+ )
+}
+
+const getEvents = cache(async () => {
+ return graphql(upcomingEventsQuery.gql, {
+ ...upcomingEventsQuery.vars,
+ repository: 'events'
+ })
+}, 'events')
+
+// const getPastEvents = cache(async () => {
+// return graphql(pastEventsQuery.gql, {
+// ...pastEventsQuery.vars,
+// repository: 'events'
+// })
+// }, 'pastEvents')
+
+export const route = {
+ load: () => [getEvents()]
+}
+
+export default function Event() {
+ const events = createAsync(getEvents)
+
+ return (
+ <>
+
+
+
+
+ {(event) => }
+
+
+
+
+ {/*
+
+ {(event) => }
+
+ */}
+ >
+ )
+}
diff --git a/src/to-refactor/events/index.jsx b/src/to-refactor/events/index.jsx
deleted file mode 100644
index b698cce..0000000
--- a/src/to-refactor/events/index.jsx
+++ /dev/null
@@ -1,100 +0,0 @@
-import { Card } from '~/components/Card'
-import { formatDate } from '~/lib/formatDate'
-import upcomingEventsQuery from '~/graphql/upcoming-events.query.js'
-import pastEventsQuery from '~/graphql/past-events.query.js'
-import graphql from '~/server/graphql.js'
-import { For, createResource } from 'solid-js'
-import bodyParser from '@zentered/issue-forms-body-parser'
-import { SimpleLayout } from '~/components/SimpleLayout'
-import { createAsync, cache } from '@solidjs/router'
-
-function EventLine(props) {
- const [issueData] = createResource(async () => {
- const data = await bodyParser(props.event.body)
- return data
- })
-
- return (
-
-
-
- {props.event.title}
-
-
- {issueData()?.['event-description'].text}
-
- Event Details
-
-
- {formatDate(issueData()?.date.date)}
-
-
- )
-}
-
-function EventReduced(props) {
- const [issueData] = createResource(async () => {
- const data = await bodyParser(props.event.body)
- return data
- })
-
- return (
-
-
-
- {props.event.title}
-
- Event Details
-
-
- {formatDate(issueData()?.date.date)}
-
-
- )
-}
-
-const getEvents = cache(async () => {
- const [upcoming] = await graphql(upcomingEventsQuery.gql, {
- ...upcomingEventsQuery.vars,
- repository: 'events'
- })
- const data = upcoming()
- console.log(data)
- return data
-}, 'events')
-
-export const route = {
- load: () => getEvents()
-}
-
-export default function Event() {
- const events = createAsync(getEvents)
-
- // const [past] = graphql(pastEventsQuery.gql, {
- // ...pastEventsQuery.vars,
- // repository: 'events'
- // })
-
- return (
- <>
-
-
- {(event) => }
-
-
- {/*
-
- {(event) => }
-
- */}
- >
- )
-}
From 562e04c79808749efd91a29b6ff1dfdea20ac3bb Mon Sep 17 00:00:00 2001
From: Patrick Heneise
Date: Sat, 2 Mar 2024 21:26:15 +0000
Subject: [PATCH 3/3] fix: remove component
---
src/components/EventLine.jsx | 33 ---------------------------------
1 file changed, 33 deletions(-)
delete mode 100644 src/components/EventLine.jsx
diff --git a/src/components/EventLine.jsx b/src/components/EventLine.jsx
deleted file mode 100644
index 3bebf38..0000000
--- a/src/components/EventLine.jsx
+++ /dev/null
@@ -1,33 +0,0 @@
-import bodyParser from '@zentered/issue-forms-body-parser'
-import { Suspense, createResource } from 'solid-js'
-import { Card } from '~/components/Card'
-import { formatDate } from '~/lib/formatDate'
-
-export function EventLine(props) {
- const [issueData] = createResource(async () => {
- return bodyParser(props.event.body)
- })
-
- return (
-
-
-
-
- {props.event.title}
-
-
- {issueData()?.['event-description'].text}
-
- Event Details
-
-
- {formatDate(issueData()?.date.date)}
-
-
-
- )
-}