diff --git a/app/text/diff/layout.tsx b/app/text/diff/layout.tsx index fdd5631..ec7fef1 100644 --- a/app/text/diff/layout.tsx +++ b/app/text/diff/layout.tsx @@ -1,10 +1,11 @@ +import { PropsWithChildren } from "react"; import { Metadata } from "next"; import { toolGroups } from "@/config/tools"; export const metadata: Metadata = { - title: toolGroups.text.tools.inspector_and_case_converter.longTitle, - description: toolGroups.text.tools.inspector_and_case_converter.description, + title: toolGroups.text.tools.diff.longTitle, + description: toolGroups.text.tools.diff.description, robots: { googleBot: { index: true, @@ -12,6 +13,6 @@ export const metadata: Metadata = { }, }; -export default function Layout({ children }: { children: React.ReactNode }) { +export default function Layout({ children }: PropsWithChildren) { return children; } diff --git a/app/text/diff/page.tsx b/app/text/diff/page.tsx index d1c59cc..3f7a716 100644 --- a/app/text/diff/page.tsx +++ b/app/text/diff/page.tsx @@ -5,16 +5,13 @@ import { Panel, PanelGroup } from "react-resizable-panels"; import { PERSISTENCE_KEY } from "@/config/persistence-keys"; import { toolGroups } from "@/config/tools"; -import { cn } from "@/lib/style"; import { DiffEditor } from "@/components/ui/diff-editor"; import { Editor } from "@/components/ui/editor"; import * as Button from "@/components/buttons"; import { Configuration } from "@/components/configuration"; import { Configurations } from "@/components/configurations"; import { ControlMenu } from "@/components/control-menu"; -import * as Icon from "@/components/icons"; import * as icons from "@/components/icons"; -import { Rows } from "@/components/icons"; import { LabeledSwitch } from "@/components/labeled-switch"; import { PageRootSection } from "@/components/page-root-section"; import { PageSection } from "@/components/page-section"; @@ -69,6 +66,7 @@ export default function Page() { ), [setInput1, clearInput1] ); + const input2Control = useMemo( () => ( (diffFullHeight ? "hidden" : ""), [diffFullHeight]); + return ( - - + + - + - + ; + +export const DiffEditor = forwardRef( + ({ options, theme, ...props }, ref) => { + const { theme: appTheme } = useTheme(); + const themeToUse = theme ?? (appTheme === "light" ? "light" : "vs-dark"); + + return ( + + ); + } +); + +DiffEditor.displayName = "Editor"; diff --git a/config/tools.ts b/config/tools.ts index fc46afc..9bc4c61 100644 --- a/config/tools.ts +++ b/config/tools.ts @@ -55,7 +55,7 @@ export const toolGroups = { shortTitle: "HTML", longTitle: "HTML Encoder / Decoder", description: - "Encode or decode all the applicable characters to their corresponding HTML entities", + "Encode or decode all the applicable characters to their corresponding HTML entities", keywords: "html encoder escaper decocder unescaper", href: "/encoders-decoders/html", }, @@ -64,7 +64,7 @@ export const toolGroups = { shortTitle: "URL", longTitle: "URL Encoder / Decoder", description: - "Encode or decode all the applicable characters to their corresponding URL entities", + "Encode or decode all the applicable characters to their corresponding URL entities", keywords: "url encoder escaper decocder unescaper", href: "/encoders-decoders/url", }, @@ -139,10 +139,10 @@ export const toolGroups = { }, diff: { Icon: icons.Diff, - shortTitle: "Text diff", - longTitle: "Text Inspector & Case Converter", - description: "Analyze text and convert it to a different case", - keywords: "case converter convert text inspector inspect", + shortTitle: "Text Diff", + longTitle: "Text Comparer", + description: "Compare two texts and highlight the differences", + keywords: "text comparer compare diff highlight", href: "/text/diff", }, },