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.

fix: Make sure browser support message clarifies cross-browser support for produced sites (#2686)

Oleg Isonenb457cf392363
diff --git a/apps/builder/app/builder/features/blocking-alerts/alert.tsx b/apps/builder/app/builder/features/blocking-alerts/alert.tsx
index 542ce7f2fd..6ab298222b 100644
--- a/apps/builder/app/builder/features/blocking-alerts/alert.tsx
+++ b/apps/builder/app/builder/features/blocking-alerts/alert.tsx
@@ -1,3 +1,4 @@
+import type { ReactNode } from "react";
import { css, Flex, Text, theme } from "@webstudio-is/design-system";
import { AlertIcon } from "@webstudio-is/icons";
@@ -16,7 +17,7 @@ const contentStyle = css({
color: theme.colors.foregroundDestructive,
});
-export const Alert = ({ message }: { message: string }) => {
+export const Alert = ({ message }: { message: string | ReactNode }) => {
return (
<Flex align="center" justify="center" className={containerStyle()}>
<Flex
@@ -26,7 +27,7 @@ export const Alert = ({ message }: { message: string }) => {
className={contentStyle()}
>
<AlertIcon size={22} />
- <Text color="contrast" variant="labelsSentenceCase" align="center">
+ <Text color="contrast" align="center">
{message}
</Text>
</Flex>
diff --git a/apps/builder/app/builder/features/blocking-alerts/blocking-alerts.tsx b/apps/builder/app/builder/features/blocking-alerts/blocking-alerts.tsx
index f8f348c72c..b0b6a72654 100644
--- a/apps/builder/app/builder/features/blocking-alerts/blocking-alerts.tsx
+++ b/apps/builder/app/builder/features/blocking-alerts/blocking-alerts.tsx
@@ -1,7 +1,8 @@
-import { useEffect, useState } from "react";
+import { useEffect, useState, type ReactNode } from "react";
import { Alert } from "./alert";
import { useWindowResizeDebounced } from "~/shared/dom-hooks";
import { isFeatureEnabled } from "@webstudio-is/feature-flags";
+import { styled, theme } from "@webstudio-is/design-system";
const useTooSmallMessage = () => {
const [message, setMessage] = useState<string>();
@@ -20,14 +21,53 @@ const useTooSmallMessage = () => {
return message;
};
+// @todo: move to design system
+// https://discord.com/channels/955905230107738152/1149380442315825212/1149408306671128666
+// https://discord.com/channels/955905230107738152/1048308525673238558/1184833931569266738
+const Link = styled("a", {
+ color: theme.colors.foregroundLink,
+ "&:visited": {
+ color: theme.colors.foregroundLinkVisited,
+ },
+});
+
const useUnsupportedBrowser = () => {
- const [message, setMessage] = useState<string>();
+ const [message, setMessage] = useState<ReactNode>();
useEffect(() => {
if ("chrome" in window || isFeatureEnabled("unsupportedBrowsers")) {
- return;
+ //return;
}
setMessage(
- "Webstudio currently supports Google Chrome and Microsoft Edge. We plan to support more browsers in the near future."
+ <>
+ The Webstudio Builder UI currently supports any{" "}
+ <Link
+ href="https://en.wikipedia.org/wiki/Chromium_(web_browser)"
+ target="_blank"
+ >
+ Chromium-based
+ </Link>{" "}
+ browsers such as{" "}
+ <Link href="https://www.google.com/chrome" target="_blank">
+ Google Chrome
+ </Link>
+ ,{" "}
+ <Link href="https://www.microsoft.com/en-us/edge" target="_blank">
+ Microsoft Edge
+ </Link>
+ ,{" "}
+ <Link href="https://brave.com/" target="_blank">
+ Brave
+ </Link>
+ ,{" "}
+ <Link href="https://arc.net/" target="_blank">
+ Arc
+ </Link>{" "}
+ and many more. We plan to support Firefox and Safari in the near future.
+ <br />
+ <br />
+ The website you&apos;re building should function correctly across all
+ browsers!
+ </>
);
}, []);
return message;
diff --git a/apps/builder/app/builder/features/topbar/publish.tsx b/apps/builder/app/builder/features/topbar/publish.tsx
index dee13529b8..0bfc6667f3 100644
--- a/apps/builder/app/builder/features/topbar/publish.tsx
+++ b/apps/builder/app/builder/features/topbar/publish.tsx
@@ -477,14 +477,13 @@ const Content = (props: {
);
};
-/**
- * @todo change colors on theme colors when tokens will be ready
- * https://discord.com/channels/955905230107738152/1149380442315825212/1149408306671128666
- **/
-const StyledLink = styled("a", {
- color: "#006ADC", // @todo theme.colors.foregroundLink,
+// @todo: move to design system
+// https://discord.com/channels/955905230107738152/1149380442315825212/1149408306671128666
+// https://discord.com/channels/955905230107738152/1048308525673238558/1184833931569266738
+const Link = styled("a", {
+ color: theme.colors.foregroundLink,
"&:visited": {
- color: "#793AAF", // @todo theme.colors.foregroundLinkVisited,
+ color: theme.colors.foregroundLinkVisited,
},
});
@@ -527,21 +526,17 @@ const ExportContent = () => {
</Text>
<Text color="subtle">
Download and install Node v18+ from{" "}
- <StyledLink
- href="https://nodejs.org/"
- target="_blank"
- rel="noreferrer"
- >
+ <Link href="https://nodejs.org/" target="_blank" rel="noreferrer">
nodejs.org
- </StyledLink>{" "}
+ </Link>{" "}
or with{" "}
- <StyledLink
+ <Link
href="https://nodejs.org/en/download/package-manager"
target="_blank"
rel="noreferrer"
>
a package manager
- </StyledLink>
+ </Link>
.
</Text>
</Grid>
@@ -580,13 +575,13 @@ const ExportContent = () => {
</Text>
<Text color="subtle">
Run this command to publish to{" "}
- <StyledLink
+ <Link
href={deployTargets[deployTarget].docs}
target="_blank"
rel="noreferrer"
>
{humanizeString(deployTarget)}
- </StyledLink>{" "}
+ </Link>{" "}
</Text>
</Grid>
@@ -629,13 +624,13 @@ const ExportContent = () => {
<Grid columns={1} gap={1}>
<Text color="subtle">
Read the detailed documentation{" "}
- <StyledLink
+ <Link
href="https://github.com/webstudio-is/webstudio/tree/main/packages/cli"
target="_blank"
rel="noreferrer"
>
here
- </StyledLink>
+ </Link>
</Text>
</Grid>
</Grid>