format project

This commit is contained in:
Kurt Hutten
2021-08-14 21:03:05 +10:00
parent 567da606f3
commit 180cbb9503
4 changed files with 19 additions and 8 deletions

View File

@@ -2,8 +2,8 @@ import { Helmet } from 'react-helmet'
import { useIsBrowser } from '@redwoodjs/prerender/browserUtils' import { useIsBrowser } from '@redwoodjs/prerender/browserUtils'
const Seo = ({ const Seo = ({
title = "CadHub", title = 'CadHub',
description = "Edit this part of CadHub", description = 'Edit this part of CadHub',
lang = 'en-US', lang = 'en-US',
socialImageUrl, socialImageUrl,
}: { }: {

View File

@@ -41,7 +41,10 @@ export const Success = ({
}: CellSuccessProps<FindSocialCardQuery>) => { }: CellSuccessProps<FindSocialCardQuery>) => {
const image = userProject?.Project?.mainImage const image = userProject?.Project?.mainImage
const gravatar = userProject?.image const gravatar = userProject?.image
const truncatedDescription = userProject?.Project?.description?.length > 150 ? (userProject?.Project?.description || '').slice(0, 145) + ' . . .' : (userProject?.Project?.description || '') const truncatedDescription =
userProject?.Project?.description?.length > 150
? (userProject?.Project?.description || '').slice(0, 145) + ' . . .'
: userProject?.Project?.description || ''
return ( return (
<div <div
className="flex-col flex h-full bg-ch-gray-800 text-ch-gray-300" className="flex-col flex h-full bg-ch-gray-800 text-ch-gray-300"
@@ -52,8 +55,7 @@ export const Success = ({
style={{ gridTemplateColumns: '7fr 5fr' }} style={{ gridTemplateColumns: '7fr 5fr' }}
> >
<div className="bg-ch-gray-800 relative"> <div className="bg-ch-gray-800 relative">
<div className="absolute bottom-0 left-0 transform scale-200 aspect-h-1 h-full -translate-x-24 translate-y-24 rotate-45 rounded-full overflow-hidden"> <div className="absolute bottom-0 left-0 transform scale-200 aspect-h-1 h-full -translate-x-24 translate-y-24 rotate-45 rounded-full overflow-hidden"></div>
</div>
<div className="relative bg-ch-gray-760 bg-opacity-90 pt-10 pl-20 pr-12 h-full backdrop-filter backdrop-blur"> <div className="relative bg-ch-gray-760 bg-opacity-90 pt-10 pl-20 pr-12 h-full backdrop-filter backdrop-blur">
<div className="flex justify-between items-center"> <div className="flex justify-between items-center">

View File

@@ -199,9 +199,13 @@ function getParams(target: HTMLElement): RawCustomizerParams {
if ( if (
numeric[elem.getAttribute('type')] || numeric[elem.getAttribute('type')] ||
elem.getAttribute('numeric') == '1' elem.getAttribute('numeric') == '1'
){ ) {
value = parseFloat(String(value || 0)) value = parseFloat(String(value || 0))
}else if (value && typeof(value) === 'string' && /^(\d+|\d+\.\d+)$/.test(value.trim())){ } else if (
value &&
typeof value === 'string' &&
/^(\d+|\d+\.\d+)$/.test(value.trim())
) {
value = parseFloat(String(value || 0)) value = parseFloat(String(value || 0))
} }
if (elem.type == 'radio' && !elem.checked) return // skip if not checked radio button if (elem.type == 'radio' && !elem.checked) return // skip if not checked radio button

View File

@@ -9,7 +9,12 @@ const IdeProjectPage = ({ userName, projectTitle }) => {
)}` )}`
return ( return (
<> <>
<Seo title={projectTitle} description={projectTitle} socialImageUrl={socialImageUrl} lang="en-US" /> <Seo
title={projectTitle}
description={projectTitle}
socialImageUrl={socialImageUrl}
lang="en-US"
/>
<IdeProjectCell userName={userName} projectTitle={projectTitle} /> <IdeProjectCell userName={userName} projectTitle={projectTitle} />
</> </>
) )