Block3rContent

A simple component that controls whether the page displays the Block3d component or the actual page content depending on the return data from useBlock3r.

/* /src/components/Block3rContent.tsx */

import { useBlock3r } from "../hooks/useBlock3r";
import Block3d from "./Block3d";
import React from "react";

export const Block3rContent = ({ children }) => {
  const { isBlock3d } = useBlock3r();

  if (isBlock3d) {
    return <Block3d />;
  } else {
    return <div>{children}</div>;
  }
};

Last updated