fix: build error

This commit is contained in:
BennyKok 2024-01-09 14:11:11 +08:00
parent 7d36f8af88
commit 8aa86bbe64
2 changed files with 27 additions and 25 deletions

View File

@ -14,7 +14,7 @@ import { handle } from "hono/vercel";
export const dynamic = "force-dynamic"; export const dynamic = "force-dynamic";
export const app = new OpenAPIHono().basePath("/api"); const app = new OpenAPIHono().basePath("/api");
declare module "hono" { declare module "hono" {
interface ContextVariableMap { interface ContextVariableMap {

View File

@ -7,33 +7,35 @@ import _SwaggerUI from "swagger-ui-react";
import "swagger-ui-react/swagger-ui.css"; import "swagger-ui-react/swagger-ui.css";
// Create the layout component // Create the layout component
class AugmentingLayout extends React.Component { // class AugmentingLayout extends React.Component {
render() { // render() {
const { getComponent } = this.props; // const { getComponent } = this.props;
const BaseLayout = getComponent("BaseLayout", true); // const BaseLayout = getComponent("BaseLayout", true);
return ( // return (
<div className="not-prose"> // <div className="not-prose">
<BaseLayout /> // <BaseLayout />
</div> // </div>
); // );
} // }
} // }
const AugmentingLayoutPlugin = () => { // const AugmentingLayoutPlugin = () => {
return { // return {
components: { // components: {
AugmentingLayout: AugmentingLayout, // AugmentingLayout: AugmentingLayout,
}, // },
}; // };
}; // };
export default function SwaggerUI(props: ComponentProps<typeof _SwaggerUI>) { export default function SwaggerUI(props: ComponentProps<typeof _SwaggerUI>) {
return ( return (
<_SwaggerUI <div className="not-prose">
{...props} <_SwaggerUI
persistAuthorization={true} {...props}
plugins={[AugmentingLayoutPlugin]} persistAuthorization={true}
layout="AugmentingLayout" // plugins={[AugmentingLayoutPlugin]}
/> // layout="AugmentingLayout"
/>
</div>
); );
} }