fix: cleanup
This commit is contained in:
@@ -1,7 +1,7 @@
|
|||||||
import { previewRequest } from "@/lib/previewRequest"
|
import { previewRequest } from "@/lib/previewRequest"
|
||||||
import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphql"
|
import { GetCurrentBlockPage } from "@/lib/graphql/Query/CurrentBlockPage.graphql"
|
||||||
|
|
||||||
import type { PageArgs, LangParams, UriParams } from "@/types/params"
|
import type { PageArgs, LangParams, PreviewParams } from "@/types/params"
|
||||||
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
|
import type { GetCurrentBlockPageData } from "@/types/requests/currentBlockPage"
|
||||||
import ContentstackLivePreview from "@contentstack/live-preview-utils"
|
import ContentstackLivePreview from "@contentstack/live-preview-utils"
|
||||||
import LoadingSpinner from "@/components/Current/LoadingSpinner"
|
import LoadingSpinner from "@/components/Current/LoadingSpinner"
|
||||||
@@ -10,11 +10,11 @@ import ContentPage from "@/components/Current/ContentPage"
|
|||||||
export default async function CurrentContentPage({
|
export default async function CurrentContentPage({
|
||||||
params,
|
params,
|
||||||
searchParams,
|
searchParams,
|
||||||
}: PageArgs<LangParams, UriParams>) {
|
}: PageArgs<LangParams, PreviewParams>) {
|
||||||
try {
|
try {
|
||||||
ContentstackLivePreview.setConfigFromParams(searchParams)
|
ContentstackLivePreview.setConfigFromParams(searchParams)
|
||||||
|
|
||||||
if (!searchParams.uri || !searchParams["live_preview"]) {
|
if (!searchParams.uri || !searchParams.live_preview) {
|
||||||
return <LoadingSpinner />
|
return <LoadingSpinner />
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
|
|
||||||
.highlightBlock {
|
.highlightBlock {
|
||||||
background: #fff;
|
|
||||||
padding: 10px 10px 15px;
|
padding: 10px 10px 15px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
|||||||
@@ -17,7 +17,12 @@ export default function Aside({ blocks }: AsideProps) {
|
|||||||
const type = block.__typename
|
const type = block.__typename
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case AsideTypenameEnum.CurrentBlocksPageAsideContact:
|
case AsideTypenameEnum.CurrentBlocksPageAsideContact:
|
||||||
return <Contacts contacts={block.contact.contactConnection.edges} />
|
return (
|
||||||
|
<Contacts
|
||||||
|
contacts={block.contact.contactConnection.edges}
|
||||||
|
key={`block-${idx}`}
|
||||||
|
/>
|
||||||
|
)
|
||||||
case AsideTypenameEnum.CurrentBlocksPageAsidePuff:
|
case AsideTypenameEnum.CurrentBlocksPageAsidePuff:
|
||||||
return (
|
return (
|
||||||
<Puffs
|
<Puffs
|
||||||
|
|||||||
@@ -10,7 +10,6 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.heroImage {
|
.heroImage {
|
||||||
object-fit: contain;
|
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: auto;
|
height: auto;
|
||||||
max-height: 600px;
|
max-height: 600px;
|
||||||
|
|||||||
@@ -7,18 +7,17 @@ import type { HeroProps } from "@/types/components/current/hero"
|
|||||||
export default function Hero({ images }: HeroProps) {
|
export default function Hero({ images }: HeroProps) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.wrapper} aria-label="Hero" tabIndex={0}>
|
<div className={styles.wrapper} aria-label="Hero" tabIndex={0}>
|
||||||
<picture className={styles.picture}>
|
{images.map(({ node: image }) => (
|
||||||
{images.map(({ node: image }) => (
|
<picture className={styles.picture} key={image.title}>
|
||||||
<Image
|
<Image
|
||||||
alt={image.title}
|
alt={image.title}
|
||||||
className={styles.heroImage}
|
className={styles.heroImage}
|
||||||
height={image.dimension.height}
|
height={image.dimension.height}
|
||||||
key={image.title}
|
|
||||||
src={image.url}
|
src={image.url}
|
||||||
width={image.dimension.width}
|
width={image.dimension.width}
|
||||||
/>
|
/>
|
||||||
))}
|
</picture>
|
||||||
</picture>
|
))}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
gap: 60px;
|
gap: 60px;
|
||||||
margin: 0 auto;
|
margin: 0 auto;
|
||||||
max-width: 1200px;
|
max-width: 1200px;
|
||||||
padding: 20px 10px 5px;
|
padding: 20px 10px 25px;
|
||||||
background: #fff;
|
background: #fff;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -13,14 +13,14 @@
|
|||||||
font-size: 1.25rem;
|
font-size: 1.25rem;
|
||||||
font-weight: 300;
|
font-weight: 300;
|
||||||
line-height: normal;
|
line-height: normal;
|
||||||
margin-bottom: 20px;
|
|
||||||
text-transform: none;
|
text-transform: none;
|
||||||
|
margin-bottom: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@media (min-width: 740px){
|
@media (min-width: 740px){
|
||||||
.container {
|
.container {
|
||||||
background: transparent;
|
background: transparent;
|
||||||
padding: 20px 30px 15px;
|
padding: 20px 30px 35px;
|
||||||
grid-template-columns: 2fr 1fr;
|
grid-template-columns: 2fr 1fr;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,11 @@ export type UriParams = {
|
|||||||
uri?: string;
|
uri?: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type PreviewParams = {
|
||||||
|
uri?: string
|
||||||
|
live_preview?: string
|
||||||
|
}
|
||||||
|
|
||||||
export type LayoutArgs<P = undefined> = P extends undefined ? {} : Params<P>;
|
export type LayoutArgs<P = undefined> = P extends undefined ? {} : Params<P>;
|
||||||
|
|
||||||
export type PageArgs<P = undefined, S = undefined> = LayoutArgs<P> &
|
export type PageArgs<P = undefined, S = undefined> = LayoutArgs<P> &
|
||||||
|
|||||||
Reference in New Issue
Block a user