[yoga-6] add nextBlocksRenderer to render json based rich text
This commit is contained in:
@@ -1,6 +1,5 @@
|
||||
'use client';
|
||||
import {BlocksContent, BlocksRenderer} from "@strapi/blocks-react-renderer";
|
||||
import strapiApi from "@/api/strapi/strapi-api";
|
||||
import React from "react";
|
||||
import YogaImageComponent from "@/components/yoga.image.component";
|
||||
|
||||
@@ -13,13 +12,11 @@ const NextBlocksRenderer = ({ content }: Props) => {
|
||||
content={content}
|
||||
blocks={{
|
||||
image: ({image}) => {
|
||||
console.log(image);
|
||||
const url = new URL(image.url);
|
||||
return (
|
||||
<YogaImageComponent
|
||||
src={url.pathname}
|
||||
width={image.width}
|
||||
height={image.height}
|
||||
src={image.url}
|
||||
// width={image.width}
|
||||
// height={image.height}
|
||||
alt={image.alternativeText || ""}
|
||||
/>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user