* feat: Full width images * lint * fix: Enable TOC overlaid on full size images * Vendorize react-medium-image-zoom * tsc * fix * Remove body scroll lock
20 lines
462 B
TypeScript
20 lines
462 B
TypeScript
import React, { useState } from "react";
|
|
import { Controlled, ControlledProps } from "./Controlled";
|
|
import Styles from "./Styles";
|
|
|
|
export type UncontrolledProps = Omit<
|
|
ControlledProps,
|
|
"isZoomed" | "onZoomChange"
|
|
>;
|
|
|
|
export default function Zoom(props: UncontrolledProps) {
|
|
const [isZoomed, setIsZoomed] = useState(false);
|
|
|
|
return (
|
|
<>
|
|
<Styles />
|
|
<Controlled {...props} isZoomed={isZoomed} onZoomChange={setIsZoomed} />
|
|
</>
|
|
);
|
|
}
|