Skip to content

Commit b32bb88

Browse files
committed
feat(404): reorganized + translations
1 parent 9f20566 commit b32bb88

File tree

11 files changed

+328
-168
lines changed

11 files changed

+328
-168
lines changed

src/assets/not_found/404_media_desktop.svg

Lines changed: 6 additions & 32 deletions
Loading

src/assets/not_found/404_media_mobile.svg

Lines changed: 114 additions & 62 deletions
Loading

src/common/Pages.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,8 @@ import CampaignPreview from 'src/pages/Campaign/preview';
1515
import Dashboard from 'src/pages/Dashboard';
1616
import Project from 'src/pages/Dashboard/Project';
1717
import LoginPage from 'src/pages/LoginPage';
18-
import NotFound from 'src/pages/NotFound';
18+
import NotFound from 'src/pages/NotFound/NotFound';
19+
import MediaNotFound from 'src/pages/NotFound/MediaNotFound';
1920
import Service from 'src/pages/Service';
2021
import Catalog from 'src/pages/Services';
2122
import Manual from 'src/pages/Manual';
@@ -72,6 +73,10 @@ const Pages = () => {
7273
element={<Service />}
7374
/>
7475
{/* No route found */}
76+
<Route
77+
path={`/${langPrefix}/media/oops`}
78+
element={<MediaNotFound />}
79+
/>
7580
<Route path={`/${langPrefix}/oops`} element={<NotFound />} />
7681
<Route index element={<Dashboard />} />
7782
</Route>

src/common/components/ErrorBoundary/ErrorBoundaryPage.tsx

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,11 @@ const ErrorBoundaryPage = () => {
3535
</Paragraph>
3636

3737
<Paragraph style={{ marginTop: theme.space.lg }}>
38-
<Button isPrimary onClick={() => window.location.reload()}>
38+
<Button
39+
isPrimary
40+
isAccent
41+
onClick={() => window.location.reload()}
42+
>
3943
{t('__ERROR_PAGE_BUTTON')}
4044
</Button>
4145
</Paragraph>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
import { styled } from 'styled-components';
2+
3+
export const Container = styled.div<{
4+
excludeMarginTop?: boolean;
5+
excludeMarginBottom?: boolean;
6+
}>`
7+
/* Hide scrollbar for Chrome, Safari and Opera */
8+
::-webkit-scrollbar {
9+
display: none;
10+
}
11+
12+
/* Hide scrollbar for IE, Edge and Firefox */
13+
-ms-overflow-style: none; /* IE and Edge */
14+
scrollbar-width: none; /* Firefox */
15+
16+
-webkit-font-smoothing: antialiased;
17+
-moz-osx-font-smoothing: grayscale;
18+
background-color: ${({ theme }) => theme.palette.grey[100]};
19+
padding-bottom: ${({ theme }) =>
20+
theme.components.chrome.header
21+
.height}; /* Fix to prevent page bottom for being cut because of the chrome fixed header height */
22+
margin: ${({ theme }) => theme.space.xxl} auto;
23+
${({ excludeMarginTop }) => excludeMarginTop && `margin-top: 0;`}
24+
${({ excludeMarginBottom }) => excludeMarginBottom && `margin-bottom: 0;`}
25+
26+
@media (max-width: ${({ theme }) => theme.breakpoints.sm}) {
27+
margin: ${({ theme }) => theme.space.md} auto;
28+
${({ excludeMarginTop }) => excludeMarginTop && `margin-top: 0;`}
29+
${({ excludeMarginBottom }) => excludeMarginBottom && `margin-bottom: 0;`}
30+
}
31+
`;

src/features/templates/Page.tsx

Lines changed: 1 addition & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,8 @@
11
import React from 'react';
22
import { GoogleTagManager } from 'src/common/GoogleTagManager';
3-
import styled from 'styled-components';
43
import { Logged } from './Logged';
54
import ErrorBoundary from '../../common/components/ErrorBoundary';
6-
7-
const Container = styled.div<{
8-
excludeMarginTop?: boolean;
9-
excludeMarginBottom?: boolean;
10-
}>`
11-
/* Hide scrollbar for Chrome, Safari and Opera */
12-
::-webkit-scrollbar {
13-
display: none;
14-
}
15-
16-
/* Hide scrollbar for IE, Edge and Firefox */
17-
-ms-overflow-style: none; /* IE and Edge */
18-
scrollbar-width: none; /* Firefox */
19-
20-
-webkit-font-smoothing: antialiased;
21-
-moz-osx-font-smoothing: grayscale;
22-
background-color: ${({ theme }) => theme.palette.grey[100]};
23-
padding-bottom: ${({ theme }) =>
24-
theme.components.chrome.header
25-
.height}; /* Fix to prevent page bottom for being cut because of the chrome fixed header height */
26-
margin: ${({ theme }) => theme.space.xxl} auto;
27-
${({ excludeMarginTop }) => excludeMarginTop && `margin-top: 0;`}
28-
${({ excludeMarginBottom }) => excludeMarginBottom && `margin-bottom: 0;`}
29-
30-
@media (max-width: ${({ theme }) => theme.breakpoints.sm}) {
31-
margin: ${({ theme }) => theme.space.md} auto;
32-
${({ excludeMarginTop }) => excludeMarginTop && `margin-top: 0;`}
33-
${({ excludeMarginBottom }) => excludeMarginBottom && `margin-bottom: 0;`}
34-
}
35-
`;
5+
import { Container } from './Container';
366

377
export const Page = ({
388
children,
@@ -68,30 +38,3 @@ export const Page = ({
6838
</ErrorBoundary>
6939
</GoogleTagManager>
7040
);
71-
72-
export const NotLoggedPage = ({
73-
children,
74-
title = 'UNGUESS - BE SMART FROM THE START',
75-
excludeMarginTop,
76-
excludeMarginBottom,
77-
className,
78-
}: {
79-
children: React.ReactNode;
80-
title?: string;
81-
excludeMarginTop?: boolean;
82-
excludeMarginBottom?: boolean;
83-
className?: string;
84-
}) => (
85-
<GoogleTagManager title={title}>
86-
<ErrorBoundary>
87-
<Container
88-
id="container"
89-
className={className}
90-
excludeMarginTop={excludeMarginTop}
91-
excludeMarginBottom={excludeMarginBottom}
92-
>
93-
{children}
94-
</Container>
95-
</ErrorBoundary>
96-
</GoogleTagManager>
97-
);

src/locales/en/translation.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
22
"__404_PAGE_BUTTON": "Back to home",
3-
"__404_PAGE_DESCRIPTION": "The page are you looking for might be removed or is temporarily unavailable.",
4-
"__404_PAGE_SUB_TITLE MAX:80": "We couldn't find the page that you are looking for",
5-
"__404_PAGE_TITLE MAX:10": "Oops!",
3+
"__404_PAGE_DESCRIPTION": "Let’s find a better place for you to go.",
4+
"__404_PAGE_SUB_TITLE MAX:80": "This page could have been removed or it’s unavailable.",
5+
"__404_PAGE_TITLE MAX:10": "We guess this page is lost.",
66
"__APP_DAYS_LABEL_one": "day",
77
"__APP_DAYS_LABEL_many": "days",
88
"__APP_DAYS_LABEL_other": "days",
@@ -115,7 +115,6 @@
115115
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_CONFIRM_TOAST": "Changes saved",
116116
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_CREATE_CUSTOM_STATUS_BUTTON": "Create a new status",
117117
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_CUSTOM_STATUS_REQUIRED": "Choose a name up to 17 characters including spaces.",
118-
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_CUSTOM_STATUS_MAX": "This name is a bit long. We recommend sticking to a maximum of 17 characters including spaces.",
119118
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_CUSTOM_STATUS_SUCCESS": "Status changed! Save it to see it on the campaign.",
120119
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_DELETE_CUSTOM_STATUS_BUTTON": "Delete status",
121120
"__BUGS_PAGE_CUSTOM_STATUS_DRAWER_EDIT_COLOR_BUTTON": "Edit color",
@@ -726,6 +725,10 @@
726725
"__LOGIN_FORM_PASSWORD_FORGOT_LABEL": "Forgot your password?",
727726
"__LOGIN_FORM_PASSWORD_PLACEHOLDER": "Insert your password",
728727
"__LOGIN_FORM_TITLE": "Log in to UNGUESS",
728+
"__MEDIA_404_PAGE_BUTTON": "Back to Home",
729+
"__MEDIA_404_PAGE_DESCRIPTION": "This page doesn’t exist or you need permission to view it.",
730+
"__MEDIA_404_PAGE_SUB_TITLE MAX:80": "You cannot access this page.",
731+
"__MEDIA_404_PAGE_TITLE MAX:10": "Hold up.",
729732
"__NOTIFICATION_CLOSE_TEXT": "Dismiss",
730733
"__NOTIFICATION_PROFILE_MODAL_COPY_EMAIL_MESSAGE": "Email address copied to clipboard",
731734
"__PAGE_BUG_EMPTY_STATE_CTA": "Try another search",

0 commit comments

Comments
 (0)