
All checks were successful
Publish Docker Image / Publish Docker Image (push) Successful in 11s
65 lines
1.5 KiB
TypeScript
65 lines
1.5 KiB
TypeScript
import type {
|
|
ContactCardPortrait,
|
|
ContactCardPortraitVariables,
|
|
} from 'types/graphql'
|
|
|
|
import { routes } from '@redwoodjs/router'
|
|
import {
|
|
type TypedDocumentNode,
|
|
type CellFailureProps,
|
|
type CellSuccessProps,
|
|
Metadata,
|
|
} from '@redwoodjs/web'
|
|
|
|
import CellEmpty from 'src/components/Cell/CellEmpty/CellEmpty'
|
|
import CellFailure from 'src/components/Cell/CellFailure/CellFailure'
|
|
import CellLoading from 'src/components/Cell/CellLoading/CellLoading'
|
|
import ContactCard from 'src/components/ContactCard/ContactCard/ContactCard'
|
|
|
|
export const QUERY: TypedDocumentNode<
|
|
ContactCardPortrait,
|
|
ContactCardPortraitVariables
|
|
> = gql`
|
|
query ContactCardPortrait {
|
|
portrait {
|
|
fileId
|
|
}
|
|
socials {
|
|
id
|
|
name
|
|
type
|
|
username
|
|
}
|
|
}
|
|
`
|
|
|
|
export const Loading = () => <CellLoading />
|
|
|
|
export const Empty = () => <CellEmpty />
|
|
|
|
export const Failure = ({ error }: CellFailureProps<ContactCardPortrait>) => (
|
|
<CellFailure error={error} />
|
|
)
|
|
|
|
export const Success = ({
|
|
portrait,
|
|
socials,
|
|
}: CellSuccessProps<ContactCardPortrait, ContactCardPortraitVariables>) => (
|
|
<>
|
|
<Metadata
|
|
title="Contact"
|
|
og={{
|
|
title: 'Contact',
|
|
type: 'website',
|
|
image: {
|
|
url: portrait.fileId,
|
|
type: 'image/webp',
|
|
alt: `${process.env.FIRST_NAME} ${process.env.LAST_NAME}`,
|
|
},
|
|
url: routes.contact(),
|
|
}}
|
|
/>
|
|
<ContactCard portraitUrl={portrait.fileId} socials={socials} />
|
|
</>
|
|
)
|