format project
This commit is contained in:
@@ -1,6 +1,16 @@
|
||||
import { Helmet } from 'react-helmet'
|
||||
|
||||
const Seo = ({ title, description, lang, socialImageUrl}: { title: string; description: string; lang: string; socialImageUrl?: string}) => {
|
||||
const Seo = ({
|
||||
title,
|
||||
description,
|
||||
lang,
|
||||
socialImageUrl,
|
||||
}: {
|
||||
title: string
|
||||
description: string
|
||||
lang: string
|
||||
socialImageUrl?: string
|
||||
}) => {
|
||||
return (
|
||||
<>
|
||||
<Helmet
|
||||
|
||||
@@ -41,7 +41,10 @@ export const Success = ({
|
||||
const image = userProject?.Project?.mainImage
|
||||
const gravatar = userProject?.image
|
||||
return (
|
||||
<div className="flex-col flex h-screen bg-ch-gray-800 text-ch-gray-300" id="social-card-loaded">
|
||||
<div
|
||||
className="flex-col flex h-screen bg-ch-gray-800 text-ch-gray-300"
|
||||
id="social-card-loaded"
|
||||
>
|
||||
<div
|
||||
className="flex-grow grid"
|
||||
style={{ gridTemplateColumns: '7fr 5fr' }}
|
||||
|
||||
@@ -9,11 +9,20 @@ import { Toaster } from '@redwoodjs/web/toast'
|
||||
const ProjectPage = ({ userName, projectTitle }) => {
|
||||
const { currentUser } = useAuth()
|
||||
const [state, thunkDispatch] = useIdeState()
|
||||
const cacheInvalidator = new Date().toISOString().split('-').slice(0, 2).join('-')
|
||||
const cacheInvalidator = new Date()
|
||||
.toISOString()
|
||||
.split('-')
|
||||
.slice(0, 2)
|
||||
.join('-')
|
||||
const socialImageUrl = `/.netlify/functions/og-image-generator/${userName}/${projectTitle}/og-image-${cacheInvalidator}.jpg`
|
||||
return (
|
||||
<>
|
||||
<Seo title={projectTitle} description={projectTitle} socialImageUrl={socialImageUrl} lang="en-US" />
|
||||
<Seo
|
||||
title={projectTitle}
|
||||
description={projectTitle}
|
||||
socialImageUrl={socialImageUrl}
|
||||
lang="en-US"
|
||||
/>
|
||||
<Toaster timeout={1500} />
|
||||
<IdeContext.Provider value={{ state, thunkDispatch, project: null }}>
|
||||
<ProjectCell
|
||||
|
||||
Reference in New Issue
Block a user