diff --git a/.changeset/chilly-trains-fail.md b/.changeset/chilly-trains-fail.md new file mode 100644 index 00000000000..47947362c4c --- /dev/null +++ b/.changeset/chilly-trains-fail.md @@ -0,0 +1,5 @@ +--- +"saleor-dashboard": patch +--- + +Login, password reset and error pages now use new Macaw buttons, text and styles. diff --git a/package-lock.json b/package-lock.json index 0af3ed21151..a8b251acc29 100644 --- a/package-lock.json +++ b/package-lock.json @@ -31,7 +31,7 @@ "@material-ui/styles": "^4.11.4", "@reach/auto-id": "^0.16.0", "@saleor/macaw-ui": "npm:@saleor/macaw-ui@0.7.4", - "@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@1.1.6", + "@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@1.1.7", "@saleor/sdk": "0.6.0", "@sentry/react": "^8.21.0", "@sentry/vite-plugin": "^2.21.1", @@ -6912,9 +6912,9 @@ }, "node_modules/@saleor/macaw-ui-next": { "name": "@saleor/macaw-ui", - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-1.1.6.tgz", - "integrity": "sha512-lDCuwQQO2OZiWyZ8yoIg771uATkPCtfwWcxG8G71nDTXSCtku5Oae5fJEUoAnGTw364YuOVwZO1mk3XbaK/YlA==", + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-1.1.7.tgz", + "integrity": "sha512-8C5rlFA7yQAhXqgcGfMk+Gd20/KZtGHY+UC7la0g0mqV6OYq5QmxyZEuLXFDZjPJ2yqMeKzXsI9ii72slo+hLw==", "dependencies": { "@dessert-box/react": "^0.4.0", "@floating-ui/react-dom": "^2.0.2", @@ -29751,9 +29751,9 @@ } }, "@saleor/macaw-ui-next": { - "version": "npm:@saleor/macaw-ui@1.1.6", - "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-1.1.6.tgz", - "integrity": "sha512-lDCuwQQO2OZiWyZ8yoIg771uATkPCtfwWcxG8G71nDTXSCtku5Oae5fJEUoAnGTw364YuOVwZO1mk3XbaK/YlA==", + "version": "npm:@saleor/macaw-ui@1.1.7", + "resolved": "https://registry.npmjs.org/@saleor/macaw-ui/-/macaw-ui-1.1.7.tgz", + "integrity": "sha512-8C5rlFA7yQAhXqgcGfMk+Gd20/KZtGHY+UC7la0g0mqV6OYq5QmxyZEuLXFDZjPJ2yqMeKzXsI9ii72slo+hLw==", "requires": { "@dessert-box/react": "^0.4.0", "@floating-ui/react-dom": "^2.0.2", diff --git a/package.json b/package.json index 57117a642af..7b6546b98da 100644 --- a/package.json +++ b/package.json @@ -39,7 +39,7 @@ "@material-ui/styles": "^4.11.4", "@reach/auto-id": "^0.16.0", "@saleor/macaw-ui": "npm:@saleor/macaw-ui@0.7.4", - "@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@1.1.6", + "@saleor/macaw-ui-next": "npm:@saleor/macaw-ui@1.1.7", "@saleor/sdk": "0.6.0", "@sentry/react": "^8.21.0", "@sentry/vite-plugin": "^2.21.1", diff --git a/src/auth/components/LoginPage/LoginPage.tsx b/src/auth/components/LoginPage/LoginPage.tsx index d4a0e25b5f4..a05b32ea054 100644 --- a/src/auth/components/LoginPage/LoginPage.tsx +++ b/src/auth/components/LoginPage/LoginPage.tsx @@ -1,13 +1,12 @@ import { UserContextError } from "@dashboard/auth/types"; import { passwordResetUrl } from "@dashboard/auth/urls"; -import { Button } from "@dashboard/components/Button"; import { FormSpacer } from "@dashboard/components/FormSpacer"; import { AvailableExternalAuthenticationsQuery } from "@dashboard/graphql"; import { SubmitPromise } from "@dashboard/hooks/useForm"; import { commonMessages } from "@dashboard/intl"; import { CircularProgress, Divider, TextField } from "@material-ui/core"; import { EyeIcon, IconButton } from "@saleor/macaw-ui"; -import { Box, Text } from "@saleor/macaw-ui-next"; +import { Box, Button, Text } from "@saleor/macaw-ui-next"; import React from "react"; import { FormattedMessage, useIntl } from "react-intl"; import { Link } from "react-router-dom"; @@ -50,13 +49,21 @@ const LoginPage: React.FC = props => { {({ change: handleChange, data, submit }) => ( - + {errors.map(error => ( -
- {getErrorMessage(error, intl)} -
+ + {getErrorMessage(error, intl)} + ))} = props => {
diff --git a/src/auth/components/styles.ts b/src/auth/components/styles.ts index 5f8c5b6a488..0440c7ebe7c 100644 --- a/src/auth/components/styles.ts +++ b/src/auth/components/styles.ts @@ -5,18 +5,11 @@ const useStyles = makeStyles( arrow: { transform: "rotate(180deg)", }, - backBtn: { - marginBottom: theme.spacing(3), - }, buttonContainer: { display: "flex", justifyContent: "flex-end", width: "100%", }, - header: { - fontWeight: 700, - marginBottom: theme.spacing(2), - }, link: { color: theme.palette.primary.main, cursor: "pointer", @@ -34,16 +27,6 @@ const useStyles = makeStyles( loginButton: { width: "100%", }, - panel: { - "& span": { - color: theme.palette.error.contrastText, - }, - ...theme.typography.body1, - background: theme.palette.alert.paper.error, - borderRadius: 8, - marginBottom: theme.spacing(2), - padding: theme.spacing(2.5), - }, passwordWrapper: { position: "relative", width: "100%", @@ -53,9 +36,6 @@ const useStyles = makeStyles( top: 6, right: 8, }, - submit: { - width: "100%", - }, }), { name: "Login" }, ); diff --git a/src/components/ErrorPage/ErrorPage.tsx b/src/components/ErrorPage/ErrorPage.tsx index e1a7aa17812..f6210a9b88a 100644 --- a/src/components/ErrorPage/ErrorPage.tsx +++ b/src/components/ErrorPage/ErrorPage.tsx @@ -2,14 +2,12 @@ import notFoundImage from "@assets/images/what.svg"; import useAppState from "@dashboard/hooks/useAppState"; import useNavigator from "@dashboard/hooks/useNavigator"; -import { Button } from "@saleor/macaw-ui"; -import { Text } from "@saleor/macaw-ui-next"; +import { Box, Button, sprinkles, Text } from "@saleor/macaw-ui-next"; import React from "react"; import SVG from "react-inlinesvg"; import { FormattedMessage } from "react-intl"; import messages from "./messages"; -import useStyles from "./styles"; export interface ErrorPageProps { onBack: () => void; @@ -17,7 +15,6 @@ export interface ErrorPageProps { } const ErrorPage: React.FC = ({ onBack, onRefresh }) => { - const classes = useStyles(); const navigate = useNavigator(); const [appState, dispatchAppState] = useAppState(); const handleOnBack = () => { @@ -33,42 +30,67 @@ const ErrorPage: React.FC = ({ onBack, onRefresh }) => { const errorTrackingId = appState.error?.type === "unhandled" ? appState.error.id : null; return ( -
-
- -
+ + + +
- + - + {!!errorTrackingId && ( -
- + + Error ID - + {errorTrackingId} -
+ )}
-
+ -
+ -
+
-
-
-
-
+ + + + ); }; diff --git a/src/components/ErrorPage/styles.ts b/src/components/ErrorPage/styles.ts deleted file mode 100644 index 302910f43bf..00000000000 --- a/src/components/ErrorPage/styles.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { makeStyles } from "@saleor/macaw-ui"; - -const useStyles = makeStyles( - theme => ({ - buttonContainer: { - marginTop: theme.spacing(2), - }, - container: { - [theme.breakpoints.down("sm")]: { - gridTemplateColumns: "1fr", - padding: theme.spacing(3), - width: "100%", - }, - display: "grid", - gridTemplateColumns: "1fr 487px", - margin: "0 auto", - gap: theme.spacing(5), - width: `calc(480px * 2 + ${theme.spacing(5)})`, - }, - conjunction: { - display: "inline-block", - margin: theme.spacing(0, 1), - }, - errorId: { - marginTop: theme.spacing(3), - letterSpacing: "0.1rem", - textTransform: "uppercase", - fontWeight: 500, - }, - innerContainer: { - [theme.breakpoints.down("sm")]: { - order: 1, - textAlign: "center", - }, - display: "flex", - flexDirection: "column", - justifyContent: "center", - }, - notFoundImage: { - width: "100%", - }, - root: { - alignItems: "center", - display: "flex", - height: "100vh", - }, - header: { - marginBottom: theme.spacing(2), - }, - }), - { name: "ErrorPage" }, -); - -export default useStyles;