diff --git a/src/to-refactor/about.jsx b/src/routes/about.jsx similarity index 80% rename from src/to-refactor/about.jsx rename to src/routes/about.jsx index 568cda7..abdd57a 100644 --- a/src/to-refactor/about.jsx +++ b/src/routes/about.jsx @@ -1,21 +1,22 @@ -import { A } from '@solidjs/router' import { GitHubIcon, LinkedInIcon } from '~/components/SocialIcons' import clsx from 'clsx' import organizationQuery from '~/graphql/organization.query.js' import graphql from '~/server/graphql.js' -import { useRouteData } from 'solid-start' -import { SimpleLayout } from '~/components/SimpleLayout' -import { For } from 'solid-js' +import { Container } from '~/components/Container' +import { For, splitProps } from 'solid-js' +import { A, createAsync, cache } from '@solidjs/router' import { H2, H3 } from '~/components/Atomic' function SocialLink(props) { + const [local, other] = splitProps(props, ['icon']) + return (
  • - + {props.children}
  • @@ -33,19 +34,19 @@ function MailIcon(props) { ) } -export function routeData() { - const [data] = graphql(organizationQuery.gql, organizationQuery.vars) - return data +const organizationData = cache(async () => { + return graphql(organizationQuery.gql, organizationQuery.vars) +}, 'organizationData') + +export const route = { + load: () => [organizationData()] } export default function About() { - const data = useRouteData() + const organization = createAsync(organizationData) return ( - +
      @@ -93,7 +94,9 @@ export default function About() { 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" > - + {(person) => (
    • - {data()?.organization.teams.name} + {organization()?.organization.teams.name}

      • @@ -124,6 +127,6 @@ export default function About() {
    -
    + ) }