-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
51252d5
commit 3551626
Showing
7 changed files
with
162 additions
and
163 deletions.
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
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
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,33 @@ | ||
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 ( | ||
<article class="md:grid md:grid-cols-4 md:items-baseline"> | ||
<Suspense> | ||
<Card class="md:col-span-3"> | ||
<Card.Title href={`/events/${props.event.number}`}> | ||
{props.event.title} | ||
</Card.Title> | ||
<Card.Description> | ||
{issueData()?.['event-description'].text} | ||
</Card.Description> | ||
<Card.Cta>Event Details</Card.Cta> | ||
</Card> | ||
<Card.Eyebrow | ||
as="time" | ||
dateTime={issueData()?.date.date} | ||
class="mt-1 hidden md:block" | ||
> | ||
{formatDate(issueData()?.date.date)} | ||
</Card.Eyebrow> | ||
</Suspense> | ||
</article> | ||
) | ||
} |
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
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
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,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 ( | ||
<article class="md:grid md:grid-cols-4 md:items-baseline"> | ||
<Suspense> | ||
<Card class="md:col-span-3"> | ||
<Card.Title href={`/events/${props.event.number}`}> | ||
{props.event.title} | ||
</Card.Title> | ||
<Card.Description> | ||
{issueData()?.['event-description'].text} | ||
</Card.Description> | ||
<Card.Cta>Event Details</Card.Cta> | ||
</Card> | ||
<Card.Eyebrow | ||
as="time" | ||
dateTime={issueData()?.date.date} | ||
class="mt-1 hidden md:block" | ||
> | ||
{formatDate(issueData()?.date.date)} | ||
</Card.Eyebrow> | ||
</Suspense> | ||
</article> | ||
) | ||
} | ||
|
||
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 ( | ||
<> | ||
<SimpleLayout title="Upcoming Events" intro=""> | ||
<Suspense> | ||
<Show when={events()}> | ||
<For each={events().repository.issues.nodes}> | ||
{(event) => <EventLine event={event} />} | ||
</For> | ||
</Show> | ||
</Suspense> | ||
</SimpleLayout> | ||
{/* <SimpleLayout title="Past Events" intro=""> | ||
<For each={events.past()?.repository?.issues.nodes}> | ||
{(event) => <EventReduced event={event} />} | ||
</For> | ||
</SimpleLayout> */} | ||
</> | ||
) | ||
} |
Oops, something went wrong.