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.

Merge branch 'main' of github.com:webstudio-is/webstudio-designer into no-gh-preview

Sara Vieirac381af696ba0
diff --cc app/auth/login.tsx
index a95f7b5242,f03e922a89..bad175ab4c
--- a/app/auth/login.tsx
+++ b/app/auth/login.tsx
@@@ -7,8 -6,8 +7,9 @@@ import
Card,
Flex,
Heading,
- TextField,
+ Tooltip,
+ Text,
+ TextField,
} from "~/shared/design-system";
import interStyles from "~/shared/font-faces/inter.css";
@@@ -31,27 -30,8 +32,27 @@@ export const links: LinksFunction = ()
export const meta: MetaFunction = () => {
return { title: "Webstudio Login" };
};
+const isPreviewDeployment = env?.VERCEL_ENV !== "preview";
+
+const WrapperDisabledTooltip = ({
+ children,
+ isPreview,
+}: {
+ children: React.ReactElement;
+ isPreview: boolean;
+}) =>
+ isPreview ? (
+ <Tooltip
+ content="Github login does not work in preview deployments"
+ delayDuration={0}
+ >
+ <span tabIndex={0}>{children}</span>
+ </Tooltip>
+ ) : (
+ children
+ );
- export const Login = () => {
+ export const Login = ({ errorMessage }: { errorMessage: string }) => {
const [isDevLogin, setIsDevLogin] = useState(false);
const loaderData = useLoaderData();
@@@ -62,20 -42,22 +63,24 @@@
align="center"
justify="center"
>
- <Card css={{ width: "$10", padding: "$5", zoom: 1.4 }} variant="active">
+ <Card css={{ width: 200, padding: "$5", zoom: 1.4 }} variant="active">
<Flex direction="column" gap="2" align="center">
<Heading>Login</Heading>
-
+ {errorMessage.length ? (
+ <Text css={{ textAlign: "center" }} variant="red">
+ {errorMessage}
+ </Text>
+ ) : null}
<Flex gap="2" direction="column" align="center">
<Form action="/auth/github" method="post">
- <Button type="submit">
- <Flex gap="1">
- <GithubIcon width="16" />
- Login with GitHub
- </Flex>
- </Button>
+ <WrapperDisabledTooltip isPreview={isPreviewDeployment}>
+ <Button type="submit" disabled={isPreviewDeployment}>
+ <Flex gap="1">
+ <GithubIcon width="16" />
+ Login with GitHub
+ </Flex>
+ </Button>
+ </WrapperDisabledTooltip>
</Form>
<Form action="/auth/google" method="post">
<Button type="submit" disabled>