Skip to content

Commit

Permalink
feat: add team page, unify layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
PatrickHeneise committed Nov 11, 2023
1 parent 11bfdbb commit 2110cf4
Show file tree
Hide file tree
Showing 9 changed files with 352 additions and 196 deletions.
19 changes: 19 additions & 0 deletions src/components/SimpleLayout.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import { Container } from '~/components/Container'
import { splitProps } from 'solid-js'

export function SimpleLayout(props) {
const [local] = splitProps(props, ['title', 'intro', 'children'])
return (
<Container class="mt-16 sm:mt-32">
<header class="max-w-2xl">
<h1 class="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl">
{local.title}
</h1>
<p class="mt-6 text-base text-zinc-600 dark:text-zinc-400">
{local.intro}
</p>
</header>
{local.children && <div class="mt-16 sm:mt-20">{local.children}</div>}
</Container>
)
}
14 changes: 14 additions & 0 deletions src/graphql/organization.query.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,20 @@ export default {
membersWithRole {
totalCount
}
teams(first: 1, query: "Advocates") {
nodes {
name
members(first: 100, orderBy: { field: LOGIN, direction: ASC }) {
nodes {
name
login
url
avatarUrl
bio
}
}
}
}
}
repository(owner: $organization, name: $repository) {
issues(labels: ["Approved :white_check_mark:", "Event :sparkles:"]) {
Expand Down
125 changes: 81 additions & 44 deletions src/routes/about.jsx
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
import { A } from 'solid-start'
import { Container } from '~/components/Container'
import Logo from '~/assets/cdc-logo.png'
import { GitHubIcon, LinkedInIcon } from '~/components/SocialIcons'
import clsx from 'clsx'
import organizationQuery from '~/graphql/organization.query.js'
import graphql from '~/lib/graphql.server.js'
import { useRouteData } from 'solid-start'
import { SimpleLayout } from '~/components/SimpleLayout'
import { For } from 'solid-js'
import { H2, H3 } from '~/components/Atomic'

function SocialLink(props) {
return (
Expand Down Expand Up @@ -41,52 +42,88 @@ export default function About() {
const data = useRouteData()

return (
<Container class="mt-16 sm:mt-32">
<div class="grid grid-cols-1 gap-y-16 lg:grid-cols-2 lg:grid-rows-[auto_1fr] lg:gap-y-12">
<div class="lg:pl-20">
<div class="max-w-xs px-2.5 lg:max-w-none">
<img
src={Logo}
alt=""
sizes="(min-width: 1024px) 32rem, 20rem"
class="aspect-square rotate-3 rounded-2xl bg-zinc-100 object-cover dark:bg-zinc-800"
/>
</div>
<SimpleLayout
title={data()?.organization?.name}
intro={data()?.organization?.description}
>
<div class="flex min-w-full">
<div class="w-1/3 mr-8">
<img
src="/assets/cdc-logo.svg"
alt="CDC Logo"
sizes="(min-width: 1024px) 32rem, 20rem"
class="aspect-square rotate-3 rounded-2xl bg-zinc-100 object-contain dark:bg-zinc-800"
/>
</div>
<div class="lg:order-first lg:row-span-2">
<h1 class="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl">
{data()?.organization?.name}
</h1>
<div class="mt-6 space-y-7 text-base text-zinc-600 dark:text-zinc-400">
{data()?.organization?.description}
</div>
<ul role="list">
<SocialLink
href={data()?.organization?.url}
icon={GitHubIcon}
class="mt-4"
>
Follow on GitHub
</SocialLink>
<SocialLink
href="https://www.linkedin.com/groups/12659214/"
icon={LinkedInIcon}
class="mt-4"
>
Follow on LinkedIn
</SocialLink>
<SocialLink
href="mailto:[email protected]"
icon={MailIcon}
class="mt-8 border-t border-zinc-100 pt-8 dark:border-zinc-700/40"
>
[email protected]
</SocialLink>
</ul>
</div>

<div class="mt-16">
<div class="">
<H2 class="">Meet the team</H2>
<p class="">
We’re a dynamic group of individuals who are passionate about what
we do.
</p>
</div>
<div class="lg:pl-20">
<ul role="list">
<SocialLink
href={data()?.organization?.url}
icon={GitHubIcon}
class="mt-4"
>
Follow on GitHub
</SocialLink>
<SocialLink
href="https://www.linkedin.com/groups/12659214/"
icon={LinkedInIcon}
class="mt-4"
>
Follow on LinkedIn
</SocialLink>
<SocialLink
href="mailto:[email protected]"
icon={MailIcon}
class="mt-8 border-t border-zinc-100 pt-8 dark:border-zinc-700/40"
>
[email protected]
</SocialLink>
<div class="mx-auto text-center">
<ul
role="list"
class="mx-auto mt-20 grid max-w-2xl grid-cols-1 gap-x-8 gap-y-16 sm:grid-cols-2 lg:mx-0 lg:max-w-none lg:grid-cols-3"
>
<For each={data()?.organization.teams.nodes[0].members.nodes}>
{(person) => (
<li>
<img
class="mx-auto h-56 w-56 rounded-full"
src={person.avatarUrl}
alt={person.name}
/>
<H3 class="mt-6 text-base font-semibold leading-7 tracking-tight text-gray-900">
{person.name}
</H3>
<p class="text-sm leading-6 text-gray-600">
{data()?.organization.teams.name}
</p>
<ul role="list" class="mt-6 flex justify-center gap-x-6">
<li>
<a
href={person.url}
class="text-gray-400 hover:text-gray-500"
>
<span class="sr-only">GitHub</span>
<GitHubIcon class="h-5 w-5" />
</a>
</li>
</ul>
</li>
)}
</For>
</ul>
</div>
</div>
</Container>
</SimpleLayout>
)
}
178 changes: 88 additions & 90 deletions src/routes/events/[id].jsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import graphql from '~/lib/graphql.server.js'
import issueQuery from '~/graphql/issue.query.js'
import { useParams, useRouteData } from 'solid-start'
import { Container } from '~/components/Container'
import { Match, Show, Switch, createMemo, createResource } from 'solid-js'
import bodyParser from '@zentered/issue-forms-body-parser'
import { SolidMarkdown } from 'solid-markdown'
import { Prose } from '~/components/Prose'
import { formatDate } from '~/lib/formatDate'
import fileQuery from '~/graphql/file.query.js'
import { A } from '@solidjs/router'
import { SimpleLayout } from '~/components/SimpleLayout'

export function routeData() {
const params = useParams()
Expand Down Expand Up @@ -47,106 +47,104 @@ export default function Event() {
const { data, issueData, location } = useRouteData()

return (
<Container class="mt-16 sm:mt-32">
<div class="grid grid-cols-1 gap-y-16 lg:grid-cols-2 lg:grid-rows-[auto_1fr] lg:gap-y-12">
<div class="lg:pl-20">
<div class="max-w-xs px-2.5 lg:max-w-none">
<Switch>
<Match when={issueData()?.['featured-image']?.images?.[0]}>
<img
src={issueData()['featured-image']?.images?.[0]?.src}
alt={issueData()['featured-image']?.images?.[0]?.alt}
sizes="(min-width: 1024px) 32rem, 20rem"
class="aspect-square rotate-3 rounded-2xl bg-zinc-100 object-cover dark:bg-zinc-800"
/>
</Match>
<Match when={!issueData()?.['featured-image']?.images}>
<img
src="/assets/cdc-logo.svg"
alt="CDC logo"
sizes="(min-width: 1024px) 32rem, 20rem"
class="aspect-square rotate-3 rounded-2xl object-cover"
/>
</Match>
</Switch>
</div>
</div>
<div class="lg:pl-20">
<dl class="w-64 space-y-8 xl:w-80">
<Show when={location}>
<div class="flex flex-col-reverse gap-y-4">
<dt class="text-base leading-7 text-gray-600">
{location.name}, {location.city}
<br />
<Show when={location.what3words}>
<A
href={`https://w3w.co/${location.what3words.replace(
'///',
''
)}`}
target="_blank"
>
{location.what3words}
</A>
</Show>
</dt>
<dd class="text-5xl font-semibold tracking-tight text-gray-900">
Where
</dd>
</div>
</Show>
</dl>
<dl class="w-64 space-y-8 xl:w-80">
<SimpleLayout
title="Meet our team"
intro="We’re a dynamic group of individuals who are passionate about what
we do."
>
<Switch>
<Match when={issueData()?.['featured-image']?.images?.[0]}>
<img
src={issueData()['featured-image']?.images?.[0]?.src}
alt={issueData()['featured-image']?.images?.[0]?.alt}
sizes="(min-width: 1024px) 32rem, 20rem"
class="aspect-square rotate-3 rounded-2xl bg-zinc-100 object-cover dark:bg-zinc-800"
/>
</Match>
<Match when={!issueData()?.['featured-image']?.images}>
<img
src="/assets/cdc-logo.svg"
alt="CDC logo"
sizes="(min-width: 1024px) 32rem, 20rem"
class="aspect-square rotate-3 rounded-2xl object-cover"
/>
</Match>
</Switch>
<div class="lg:pl-20">
<dl class="w-64 space-y-8 xl:w-80">
<Show when={location}>
<div class="flex flex-col-reverse gap-y-4">
<dt class="text-base leading-7 text-gray-600">
{formatDate(issueData()?.['date'].date)} -{' '}
{issueData()?.['time'].time}
{location.name}, {location.city}
<br />
Duration: {issueData()?.['duration'].text}
<Show when={location.what3words}>
<A
href={`https://w3w.co/${location.what3words.replace(
'///',
''
)}`}
target="_blank"
>
{location.what3words}
</A>
</Show>
</dt>
<dd class="text-5xl font-semibold tracking-tight text-gray-900">
When
Where
</dd>
</div>
</dl>
<dl class="w-64 space-y-8 xl:w-80">
<Show when={issueData()?.['code-of-conduct']}>
<div class="flex flex-col-reverse gap-y-4">
<dt class="text-base leading-7 text-gray-600">
<SolidMarkdown>
{issueData()['code-of-conduct'].list[0].text}
</SolidMarkdown>
</dt>
<dd class="text-5xl font-semibold tracking-tight text-gray-900">
Code of Conduct
</dd>
</div>
</Show>
</dl>
</div>
<Show when={issueData()?.['date']}>
<div class="lg:order-first lg:row-span-2">
<time
class={
'relative z-10 order-first mb-3 flex items-center text-sm text-zinc-800 dark:text-zinc-500 pl-3.5'
}
>
</Show>
</dl>
<dl class="w-64 space-y-8 xl:w-80">
<div class="flex flex-col-reverse gap-y-4">
<dt class="text-base leading-7 text-gray-600">
{formatDate(issueData()?.['date'].date)} -{' '}
{issueData()['time'].time}
</time>
<h1 class="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl">
{data()?.repository.issue.title}
</h1>
<div class="mt-6 space-y-7 text-base text-zinc-600 dark:text-zinc-400">
<Prose>
{issueData()?.['time'].time}
<br />
Duration: {issueData()?.['duration'].text}
</dt>
<dd class="text-5xl font-semibold tracking-tight text-gray-900">
When
</dd>
</div>
</dl>
<dl class="w-64 space-y-8 xl:w-80">
<Show when={issueData()?.['code-of-conduct']}>
<div class="flex flex-col-reverse gap-y-4">
<dt class="text-base leading-7 text-gray-600">
<SolidMarkdown>
{issueData()?.['event-description'].text}
{issueData()['code-of-conduct'].list[0].text}
</SolidMarkdown>
</Prose>
</dt>
<dd class="text-5xl font-semibold tracking-tight text-gray-900">
Code of Conduct
</dd>
</div>
</div>
</Show>
</Show>
</dl>
</div>
</Container>
<Show when={issueData()?.['date']}>
<div class="lg:order-first lg:row-span-2">
<time
class={
'relative z-10 order-first mb-3 flex items-center text-sm text-zinc-800 dark:text-zinc-500 pl-3.5'
}
>
{formatDate(issueData()?.['date'].date)} -{' '}
{issueData()['time'].time}
</time>
<h1 class="text-4xl font-bold tracking-tight text-zinc-800 dark:text-zinc-100 sm:text-5xl">
{data()?.repository.issue.title}
</h1>
<div class="mt-6 space-y-7 text-base text-zinc-600 dark:text-zinc-400">
<Prose>
<SolidMarkdown>
{issueData()?.['event-description'].text}
</SolidMarkdown>
</Prose>
</div>
</div>
</Show>
</SimpleLayout>
)
}
Loading

0 comments on commit 2110cf4

Please sign in to comment.