{({ change: handleChange, data, submit }) => (
<>
+
+
+
{error && (
-
- {getErrorMessage(error, intl)}
-
+ {getErrorMessage(error, intl)}
)}
= props => {
disabled={disabled}
/>
-
-
+
+
+ {/* Not using endAdornment as it looks weird with autocomplete */}
+ setShowPassword(true)}
+ onMouseUp={() => setShowPassword(false)}
+ >
+
+
+
+
+
+
-
-
-
-
-
- )
- }}
- />
-
+
{externalAuthentications.length > 0 && (
<>
diff --git a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx
index f7c8b764d4e..0aa73a2221d 100644
--- a/src/auth/components/NewPasswordPage/NewPasswordPage.tsx
+++ b/src/auth/components/NewPasswordPage/NewPasswordPage.tsx
@@ -1,31 +1,13 @@
-import { SetPasswordData } from "@saleor/sdk";
import { TextField, Typography } from "@material-ui/core";
import Form from "@saleor/components/Form";
import FormSpacer from "@saleor/components/FormSpacer";
-import { Button, makeStyles } from "@saleor/macaw-ui";
+import { Button } from "@saleor/macaw-ui";
+import { SetPasswordData } from "@saleor/sdk";
import getAccountErrorMessage from "@saleor/utils/errors/account";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
-const useStyles = makeStyles(
- theme => ({
- errorText: {
- color: theme.palette.error.contrastText
- },
- panel: {
- background: theme.palette.error.main,
- borderRadius: theme.spacing(),
- marginBottom: theme.spacing(3),
- padding: theme.spacing(1.5)
- },
- submit: {
- width: "100%"
- }
- }),
- {
- name: "NewPasswordPage"
- }
-);
+import useStyles from "../styles";
export interface NewPasswordPageFormData {
password: string;
@@ -60,13 +42,7 @@ const NewPasswordPage: React.FC = props => {
return (
<>
- {!!error && (
-
-
- {error}
-
-
- )}
+ {!!error && {error}
}
diff --git a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx
index f4254fba0af..9218b0f3f15 100644
--- a/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx
+++ b/src/auth/components/ResetPasswordPage/ResetPasswordPage.tsx
@@ -2,29 +2,11 @@ import { TextField, Typography } from "@material-ui/core";
import Form from "@saleor/components/Form";
import FormSpacer from "@saleor/components/FormSpacer";
import { commonMessages } from "@saleor/intl";
-import { Button, makeStyles } from "@saleor/macaw-ui";
+import { Button } from "@saleor/macaw-ui";
import React from "react";
import { FormattedMessage, useIntl } from "react-intl";
-const useStyles = makeStyles(
- theme => ({
- errorText: {
- color: theme.palette.error.contrastText
- },
- panel: {
- background: theme.palette.error.main,
- borderRadius: theme.spacing(),
- marginBottom: theme.spacing(3),
- padding: theme.spacing(1.5)
- },
- submit: {
- width: "100%"
- }
- }),
- {
- name: "ResetPasswordPage"
- }
-);
+import useStyles from "../styles";
export interface ResetPasswordPageFormData {
email: string;
@@ -45,13 +27,7 @@ const ResetPasswordPage: React.FC = props => {