mirror of
https://github.com/jakejarvis/jarv.is.git
synced 2026-06-05 20:15:31 -04:00
refactor: migrate from Biome to oxlint/oxfmt, remove contact form
- Replace Biome with oxlint + oxfmt (OXC toolchain) for linting and formatting - Add .oxlintrc.json and .oxfmtrc.json configuration files - Update VS Code settings and devcontainer to use oxc-vscode extension - Remove contact form, Resend email integration, and related server action/schema - Remove unused UI components (accordion, alert, card, tabs, toggle, etc.)
This commit is contained in:
@@ -2,10 +2,8 @@
|
||||
|
||||
import { getImageProps } from "next/image";
|
||||
import { Children } from "react";
|
||||
import {
|
||||
ReactCompareSlider,
|
||||
ReactCompareSliderImage,
|
||||
} from "react-compare-slider";
|
||||
import { ReactCompareSlider, ReactCompareSliderImage } from "react-compare-slider";
|
||||
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const ImageDiff = ({
|
||||
@@ -18,16 +16,12 @@ const ImageDiff = ({
|
||||
// Extract the two image children
|
||||
const childrenArray = Children.toArray(children);
|
||||
if (childrenArray.length !== 2) {
|
||||
console.error(
|
||||
"ImageDiff must have exactly two children (before and after images)",
|
||||
);
|
||||
console.error("ImageDiff must have exactly two children (before and after images)");
|
||||
return null;
|
||||
}
|
||||
|
||||
// Get the original image source to extract dimensions for aspect ratio
|
||||
const firstChildProps = children[0].props as Parameters<
|
||||
typeof getImageProps
|
||||
>[0];
|
||||
const firstChildProps = children[0].props as Parameters<typeof getImageProps>[0];
|
||||
const imageSrc = firstChildProps.src;
|
||||
const aspectRatio =
|
||||
typeof imageSrc === "object" && "width" in imageSrc && "height" in imageSrc
|
||||
@@ -42,23 +36,10 @@ const ImageDiff = ({
|
||||
|
||||
return (
|
||||
<ReactCompareSlider
|
||||
className={cn(
|
||||
"my-8 w-full max-w-full overflow-hidden rounded-sm",
|
||||
className,
|
||||
)}
|
||||
className={cn("my-8 w-full max-w-full overflow-hidden rounded-sm", className)}
|
||||
style={{ aspectRatio }}
|
||||
itemOne={
|
||||
<ReactCompareSliderImage
|
||||
{...beforeImageProps}
|
||||
className="size-full object-cover"
|
||||
/>
|
||||
}
|
||||
itemTwo={
|
||||
<ReactCompareSliderImage
|
||||
{...afterImageProps}
|
||||
className="size-full object-cover"
|
||||
/>
|
||||
}
|
||||
itemOne={<ReactCompareSliderImage {...beforeImageProps} className="size-full object-cover" />}
|
||||
itemTwo={<ReactCompareSliderImage {...afterImageProps} className="size-full object-cover" />}
|
||||
/>
|
||||
);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user