Skip to content

Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.

Use remix link for link block (#1217)

Oleg Isonen73f5f99dc29e
diff --git a/apps/builder/app/canvas/custom-components/index.ts b/apps/builder/app/canvas/custom-components/index.ts
index e4cf7a2b3d..487f05b424 100644
--- a/apps/builder/app/canvas/custom-components/index.ts
+++ b/apps/builder/app/canvas/custom-components/index.ts
@@ -4,5 +4,6 @@ import { wrapLinkComponent } from "./link";
export const customComponents = {
...baseCustomComponents,
Link: wrapLinkComponent(baseCustomComponents.Link),
+ LinkBlock: wrapLinkComponent(baseCustomComponents.LinkBlock),
RichTextLink: wrapLinkComponent(baseCustomComponents.RichTextLink),
};
diff --git a/packages/react-sdk/src/app/custom-components/index.ts b/packages/react-sdk/src/app/custom-components/index.ts
index e6a43ec561..17ec312362 100644
--- a/packages/react-sdk/src/app/custom-components/index.ts
+++ b/packages/react-sdk/src/app/custom-components/index.ts
@@ -1,5 +1,6 @@
import { Image } from "./image";
import { Link } from "./link";
+import { LinkBlock } from "./link-block";
import { RichTextLink } from "./rich-text-link";
import { imageProps } from "@webstudio-is/image";
import type { WsComponentPropsMeta } from "../../components/component-type";
@@ -8,6 +9,7 @@ export const customComponents = {
Image,
Link,
RichTextLink,
+ LinkBlock,
};
export const customComponentPropsMetas: Record<string, WsComponentPropsMeta> = {
diff --git a/packages/react-sdk/src/app/custom-components/link-block.tsx b/packages/react-sdk/src/app/custom-components/link-block.tsx
new file mode 100644
index 0000000000..1f4c1c6ae7
--- /dev/null
+++ b/packages/react-sdk/src/app/custom-components/link-block.tsx
@@ -0,0 +1,4 @@
+import { LinkBlock as BaseLink } from "../../components/link-block";
+import { wrapLinkComponent } from "./shared/remix-link";
+
+export const LinkBlock = wrapLinkComponent(BaseLink);