Skip to content

Commit

Permalink
indicators
Browse files Browse the repository at this point in the history
  • Loading branch information
rwieruch committed Apr 16, 2020
1 parent 38d1c0c commit 1f5601d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/screens/Account/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ const AccountPage: NextAuthPage = ({ data }) => {
</Card>
</Col>
<Col span={12}>
<Card title="Partner">
<Card title="Programs">
<ul>
<li>
<Link href={ROUTES.PARTNER}>Partner Program</Link>
Expand Down
3 changes: 3 additions & 0 deletions src/screens/EmailChange/EmailChangeForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,9 @@ const EmailChangeForm = ({ form }: EmailChangeFormProps) => {
const { successMessage } = useIndicators({
key: 'email-change',
error,
success: {
message: 'Success! You can use your new email now.',
},
});

const [confirmEmailDirty, setConfirmEmailDirty] = React.useState(
Expand Down
3 changes: 3 additions & 0 deletions src/screens/PasswordChange/PasswordChangeForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const PasswordChangeForm = ({ form }: PasswordChangeFormProps) => {
const { successMessage } = useIndicators({
key: 'password-change',
error,
success: {
message: 'Success! You can use your new password now.',
},
});

const [
Expand Down
10 changes: 8 additions & 2 deletions src/screens/PasswordForgot/PasswordForgotForm/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FormComponentProps } from 'antd/lib/form';
import { usePasswordForgotMutation } from '@generated/client';
import FormItem from '@components/Form/Item';
import FormStretchedButton from '@components/Form/StretchedButton';
import useErrorIndicator from '@hooks/useErrorIndicator';
import useIndicators from '@hooks/useIndicators';

interface PasswordForgotFormProps extends FormComponentProps {}

Expand All @@ -15,7 +15,11 @@ const PasswordForgotForm = ({ form }: PasswordForgotFormProps) => {
{ loading, error },
] = usePasswordForgotMutation();

useErrorIndicator({ error });
const { successMessage } = useIndicators({
key: 'password-forgot',
error,
success: { message: 'Success! Check your email inbox.' },
});

const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
form.validateFields(async (error, values) => {
Expand All @@ -28,6 +32,8 @@ const PasswordForgotForm = ({ form }: PasswordForgotFormProps) => {
},
});

successMessage();

form.resetFields();
} catch (error) {}
});
Expand Down

0 comments on commit 1f5601d

Please sign in to comment.