Files
webstudio/apps/builder/app/shared/error/error-message.client.tsx
T
Oleg Isonen 8f3592d594 feat: Login and error page redesign (#4777)
## Description

<img width="1512" alt="image"
src="https://github.com/user-attachments/assets/c61e93e0-f981-428d-8d8f-7101cdf43c2b"
/>

<img width="449" alt="image"
src="https://github.com/user-attachments/assets/f030d9c2-ddaf-481d-9292-d2e5619939b7"
/>

<img width="1507" alt="image"
src="https://github.com/user-attachments/assets/14bc4742-5d87-47f7-8704-db83674b115e"
/>

1. What is this PR about (link the issue and add a short description)

## Steps for reproduction

1. click button
2. expect xyz

## Code Review

- [ ] hi @kof, I need you to do
  - conceptual review (architecture, feature-correctness)
  - detailed review (read every line)
  - test it on preview

## Before requesting a review

- [ ] made a self-review
- [ ] added inline comments where things may be not obvious (the "why",
not "what")

## Before merging

- [ ] tested locally and on preview environment (preview dev login:
0000)
- [ ] updated [test
cases](https://github.com/webstudio-is/webstudio/blob/main/apps/builder/docs/test-cases.md)
document
- [ ] added tests
- [ ] if any new env variables are added, added them to `.env` file
2025-01-23 02:06:31 +01:00

102 lines
2.2 KiB
TypeScript

import {
AccessibleIcon,
css,
Grid,
Link,
Text,
theme,
buttonStyle,
} from "@webstudio-is/design-system";
import { WebstudioIcon } from "@webstudio-is/icons";
const pageStyle = css({
position: "fixed",
justifyItems: "center",
alignContent: "start",
inset: 0,
background: theme.colors.brandBackgroundDashboard,
paddingTop: "10vh",
});
export const ErrorMessage = ({
error,
}: {
error: {
status: number;
statusText?: string;
message: string;
description?: string;
};
}) => {
return (
<Grid className={pageStyle()} justify={"center"} gap={6}>
<AccessibleIcon label="Logo">
<WebstudioIcon size="60" />
</AccessibleIcon>
<div />
<div />
<Text
css={{
fontSize: theme.spacing[21],
lineHeight: 1,
}}
variant={"bigTitle"}
>
{error.status}
</Text>
<Grid
css={{
justifyItems: "center",
marginInline: theme.spacing[10],
maxWidth: 600,
}}
gap={5}
>
<Grid
css={{
background: theme.colors.backgroundPanel,
padding: theme.spacing[7],
borderRadius: theme.spacing[5],
minWidth: theme.spacing[34],
}}
gap="3"
>
<Text
css={{
display: "-webkit-box",
"-webkit-line-clamp": 4,
"-webkit-box-orient": "vertical",
overflow: "hidden",
textOverflow: "ellipsis",
wordBreak: "break-word",
}}
variant="brandSectionTitle"
userSelect="text"
>
{error.message ?? error.statusText}
</Text>
{error.description && (
<Text
css={{ wordBreak: "break-word", whiteSpace: "pre-line" }}
userSelect="text"
variant="brandRegular"
>
{error.description}
</Text>
)}
</Grid>
<Link
href="/"
className={buttonStyle()}
color="contrast"
underline="none"
>
Go Home
</Link>
</Grid>
</Grid>
);
};