fix featured block text type issue
This commit is contained in:
@ -3,7 +3,17 @@ import Link from "next/link";
|
|||||||
import Image from "../general/Image";
|
import Image from "../general/Image";
|
||||||
import styles from "./featuredBlock.module.scss";
|
import styles from "./featuredBlock.module.scss";
|
||||||
|
|
||||||
export const FeaturedBlock = ({ block }: { block: FeaturedBlockType }) => {
|
// the 'text' field has been aliased to 'featuredBlockText' and i'm
|
||||||
|
// using codegen the wrong way. let's specify the field here and move on
|
||||||
|
type FeaturedBlockTypeWithAlias = FeaturedBlockType & {
|
||||||
|
featuredBlockText: string;
|
||||||
|
};
|
||||||
|
|
||||||
|
export const FeaturedBlock = ({
|
||||||
|
block,
|
||||||
|
}: {
|
||||||
|
block: FeaturedBlockTypeWithAlias;
|
||||||
|
}) => {
|
||||||
const image = !!block.featuredImageOverride
|
const image = !!block.featuredImageOverride
|
||||||
? block.featuredImageOverride
|
? block.featuredImageOverride
|
||||||
: null;
|
: null;
|
||||||
@ -20,7 +30,6 @@ export const FeaturedBlock = ({ block }: { block: FeaturedBlockType }) => {
|
|||||||
</div>
|
</div>
|
||||||
{image && (
|
{image && (
|
||||||
<div className={styles.image}>
|
<div className={styles.image}>
|
||||||
{" "}
|
|
||||||
<Image
|
<Image
|
||||||
src={image.url}
|
src={image.url}
|
||||||
alt={image.alt ?? ""}
|
alt={image.alt ?? ""}
|
||||||
|
Reference in New Issue
Block a user