From 6cb0d4100d77ba98faf5e1fb3aa2b5ca7c476630 Mon Sep 17 00:00:00 2001 From: Ani Date: Tue, 9 Jul 2024 12:48:02 +0300 Subject: [PATCH 1/2] Update the buttons on Irregularity page (#1875) Co-authored-by: ani-kalpachka --- .../client/irregularity/Actions.tsx | 13 ++----- .../helpers/Irregularity.styled.tsx | 39 ++----------------- 2 files changed, 8 insertions(+), 44 deletions(-) diff --git a/src/components/client/irregularity/Actions.tsx b/src/components/client/irregularity/Actions.tsx index dc3ad9311..0ff04fdc2 100644 --- a/src/components/client/irregularity/Actions.tsx +++ b/src/components/client/irregularity/Actions.tsx @@ -8,12 +8,7 @@ import { Grid } from '@mui/material' import ArrowBackIosIcon from '@mui/icons-material/ArrowBackIos' import ArrowForwardIosIcon from '@mui/icons-material/ArrowForwardIos' -import { - ActionButton, - ActionLinkButton, - ActionSubmitButton, - Root, -} from './helpers/Irregularity.styled' +import { ActionButton, ActionLinkButton, ActionSubmitButton } from './helpers/Irregularity.styled' type ActionsProps = { nextLabel: string @@ -37,12 +32,12 @@ export default function Actions({ const { t } = useTranslation('irregularity') return ( - + {activeStep === 0 ? ( }> {t(backLabel)} @@ -64,6 +59,6 @@ export default function Actions({ endIcon={} /> - + ) } diff --git a/src/components/client/irregularity/helpers/Irregularity.styled.tsx b/src/components/client/irregularity/helpers/Irregularity.styled.tsx index 8eb5f1a3e..0dcae4157 100644 --- a/src/components/client/irregularity/helpers/Irregularity.styled.tsx +++ b/src/components/client/irregularity/helpers/Irregularity.styled.tsx @@ -24,61 +24,30 @@ export const ButtonsWrapper = styled(Grid)(() => ({ })) export const ActionLinkButton = styled(LinkButton)(() => ({ - backgroundColor: '#0098E3', - border: `1px solid ${theme.palette.secondary.light}`, - padding: theme.spacing(1, 5), - borderRadius: theme.borders.round, - color: theme.palette.common.white, - fontSize: theme.typography.pxToRem(18), + fontSize: theme.typography.pxToRem(14), '&:hover': { - backgroundColor: '#62C4FB', - color: theme.palette.common.black, - border: `1px solid ${theme.palette.secondary.light}`, - }, - - [theme.breakpoints.down('md')]: { - fontSize: theme.typography.pxToRem(11), - marginBottom: theme.spacing(4), + backgroundColor: 'transparent', }, })) export const ActionButton = styled(Button)(() => ({ - backgroundColor: '#0098E3', - border: `1px solid ${theme.palette.secondary.light}`, - padding: theme.spacing(1, 5), - borderRadius: theme.borders.round, - color: theme.palette.common.white, - fontSize: theme.typography.pxToRem(18), + fontSize: theme.typography.pxToRem(14), '&:hover': { - backgroundColor: '#62C4FB', color: theme.palette.common.black, - border: `1px solid ${theme.palette.secondary.light}`, - }, - - [theme.breakpoints.down('md')]: { - fontSize: theme.typography.pxToRem(11), - marginBottom: theme.spacing(4), }, })) export const ActionSubmitButton = styled(SubmitButton)(() => ({ - backgroundColor: '#0098E3', border: `1px solid ${theme.palette.secondary.light}`, padding: theme.spacing(1, 5), borderRadius: theme.borders.round, color: theme.palette.common.white, - fontSize: theme.typography.pxToRem(18), + fontSize: theme.typography.pxToRem(14), '&:hover': { - backgroundColor: '#62C4FB', color: theme.palette.common.black, border: `1px solid ${theme.palette.secondary.light}`, }, - - [theme.breakpoints.down('md')]: { - fontSize: theme.typography.pxToRem(11), - marginBottom: theme.spacing(4), - }, })) From 04b266c51d90edddd80965af7e96398cff83f2e8 Mon Sep 17 00:00:00 2001 From: Ani Date: Tue, 9 Jul 2024 12:48:39 +0300 Subject: [PATCH 2/2] Change Back button on Not Found page to redirect to the previous page (#1877) Co-authored-by: ani-kalpachka --- .../common/errors/NotFoundPage/NotFoundPage.styled.tsx | 5 ++--- .../common/errors/NotFoundPage/NotFoundPage.tsx | 9 +++++++-- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/src/components/common/errors/NotFoundPage/NotFoundPage.styled.tsx b/src/components/common/errors/NotFoundPage/NotFoundPage.styled.tsx index 3d76c63b0..f515594e2 100644 --- a/src/components/common/errors/NotFoundPage/NotFoundPage.styled.tsx +++ b/src/components/common/errors/NotFoundPage/NotFoundPage.styled.tsx @@ -1,7 +1,6 @@ -import { Stack, Typography } from '@mui/material' +import { Stack, Typography, Button } from '@mui/material' import { styled } from '@mui/material/styles' -import LinkButton from 'components/common/LinkButton' import theme from 'common/theme' export const Root = styled(Stack)(() => ({ @@ -14,7 +13,7 @@ export const ErrorMessage = styled(Typography)(() => ({ maxWidth: theme.spacing(80), })) -export const BackButton = styled(LinkButton)(() => ({ +export const BackButton = styled(Button)(() => ({ color: theme.palette.primary.dark, borderColor: theme.palette.primary.dark, })) diff --git a/src/components/common/errors/NotFoundPage/NotFoundPage.tsx b/src/components/common/errors/NotFoundPage/NotFoundPage.tsx index af3fe018e..ff3b11df0 100644 --- a/src/components/common/errors/NotFoundPage/NotFoundPage.tsx +++ b/src/components/common/errors/NotFoundPage/NotFoundPage.tsx @@ -1,8 +1,8 @@ import { useTranslation } from 'next-i18next' +import { useRouter } from 'next/router' import { Grid } from '@mui/material' import ArrowBackIcon from '@mui/icons-material/ArrowBack' -import { routes } from 'common/routes' import Layout from 'components/client/layout/Layout' import NotFoundIllustration from '../assets/NotFoundIllustration' @@ -10,6 +10,11 @@ import { BackButton, ErrorMessage, Root } from './NotFoundPage.styled' export default function NotFoundPage() { const { t } = useTranslation('common') + const router = useRouter() + + const handleBackClick = () => { + router.back() + } return ( @@ -22,7 +27,7 @@ export default function NotFoundPage() { size="large" startIcon={} variant="outlined" - href={routes.index}> + onClick={handleBackClick}> {t('errors.backButtonLabel')}