Skip to content

Commit

Permalink
chore: replace success with notification
Browse files Browse the repository at this point in the history
  • Loading branch information
bjarneo committed Apr 9, 2023
1 parent 4a57e9b commit af17314
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 50 deletions.
32 changes: 0 additions & 32 deletions src/client/components/info/style.module.css

This file was deleted.

10 changes: 0 additions & 10 deletions src/client/components/info/success.jsx

This file was deleted.

13 changes: 9 additions & 4 deletions src/client/routes/signin/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
Title,
Text,
PasswordInput,
Notification,
} from '@mantine/core';
import { useDispatch } from 'react-redux';
import { useForm } from '@mantine/form';
import { IconLock, IconUser, IconLogin, IconAlertCircle } from '@tabler/icons';
import { IconLock, IconUser, IconLogin, IconAlertCircle, IconCheck } from '@tabler/icons';
import { useTranslation } from 'react-i18next';

import Success from '../../components/info/success';
import { signIn } from '../../api/authentication';
import { userLogin } from '../../actions';

Expand Down Expand Up @@ -105,9 +105,14 @@ const SignIn = () => {
</form>

{success && (
<Success>
<Notification
icon={<IconCheck size="1.1rem" />}
color="teal"
title={t('settings.success')}
withCloseButton={false}
>
Redirecting to your account page. <Redirect to="/account" />
</Success>
</Notification>
)}
</Container>
);
Expand Down
13 changes: 9 additions & 4 deletions src/client/routes/signup/index.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,13 @@ import {
Title,
Text,
PasswordInput,
Notification,
} from '@mantine/core';
import { useDispatch } from 'react-redux';
import { useForm } from '@mantine/form';
import { IconLock, IconUser, IconLogin, IconAt, IconAlertCircle } from '@tabler/icons';
import { IconLock, IconUser, IconLogin, IconAt, IconAlertCircle, IconCheck } from '@tabler/icons';
import { useTranslation } from 'react-i18next';

import Success from '../../components/info/success';
import { signUp } from '../../api/authentication';
import { userLogin } from '../../actions';

Expand Down Expand Up @@ -114,10 +114,15 @@ const SignUp = () => {
</form>

{success && (
<Success>
<Notification
icon={<IconCheck size="1.1rem" />}
color="teal"
title={t('settings.success')}
withCloseButton={false}
>
Redirecting to your account page.
<Redirect to="/account" />
</Success>
</Notification>
)}
</Container>
);
Expand Down

0 comments on commit af17314

Please sign in to comment.