From 69f0d520d06506269fbf36ae1fa205e358198784 Mon Sep 17 00:00:00 2001 From: Petro Silenius Date: Sun, 13 Feb 2022 19:39:05 +0200 Subject: [PATCH 1/6] Create custom 404 page --- pages/404.tsx | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 pages/404.tsx diff --git a/pages/404.tsx b/pages/404.tsx new file mode 100644 index 0000000..d862645 --- /dev/null +++ b/pages/404.tsx @@ -0,0 +1,29 @@ +import Head from 'next/head'; +import Link from 'next/link'; +import { Button, Grid, Typography, Link as MuiLink } from '@mui/material'; + +const Custom404 = () => { + return ( +
+ + + + 404 + + + + + Sivua ei löytynyt + + + + + + + + +
+ ); +}; + +export default Custom404; From a891a955fdf3d33cd0cf8cb8834772b19d52ad13 Mon Sep 17 00:00:00 2001 From: Petro Silenius Date: Sun, 13 Feb 2022 19:39:24 +0200 Subject: [PATCH 2/6] Set filter fields to fullwidth on mobile resolutions --- components/SearchForm.tsx | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/components/SearchForm.tsx b/components/SearchForm.tsx index eb47a61..b8bf94c 100644 --- a/components/SearchForm.tsx +++ b/components/SearchForm.tsx @@ -101,7 +101,7 @@ const SearchForm = ({ alignItems="center" sx={{ pt: '5px', pb: '15px', borderBottom: '1px solid #C4C4C4' }} > - + - + } /> - + } /> - + From 651fd281046accd3dbb99b9b0dc534fc3d85ed29 Mon Sep 17 00:00:00 2001 From: Petro Silenius Date: Sun, 13 Feb 2022 22:34:14 +0200 Subject: [PATCH 6/6] Run prettier --- components/CertificateItem.tsx | 1 - components/CompanyListItem.tsx | 42 ++++++++++++++++++++-------------- components/SearchForm.tsx | 15 +++++++----- pages/404.tsx | 29 +++++++++++++---------- pages/[id].tsx | 4 +++- 5 files changed, 54 insertions(+), 37 deletions(-) diff --git a/components/CertificateItem.tsx b/components/CertificateItem.tsx index b99cbc0..d6823fc 100644 --- a/components/CertificateItem.tsx +++ b/components/CertificateItem.tsx @@ -8,7 +8,6 @@ const CertificateItem = ({ certificate }: { certificate: Certificate }) => { const theme = useTheme(); const mobile = useMediaQuery(theme.breakpoints.down('sm')); - return ( diff --git a/components/CompanyListItem.tsx b/components/CompanyListItem.tsx index 0d1c6c2..35bd61b 100644 --- a/components/CompanyListItem.tsx +++ b/components/CompanyListItem.tsx @@ -10,24 +10,32 @@ const capitalizeFirstLetter = (string: string) => { const CompanyListItem = ({ company }: { company: Company }) => { return ( - - - - - {company.name} - - - {capitalizeFirstLetter(company.city)} - - - {company.certificateId?.map((id) => { - const certificate = certificates.find((certificate) => certificate.id === id); - if (certificate) { - return ; - } - })} - + + + + + {company.name} + + + {capitalizeFirstLetter(company.city)} + + {company.certificateId?.map((id) => { + const certificate = certificates.find((certificate) => certificate.id === id); + if (certificate) { + return ; + } + })} + + ); }; diff --git a/components/SearchForm.tsx b/components/SearchForm.tsx index b8bf94c..2a15904 100644 --- a/components/SearchForm.tsx +++ b/components/SearchForm.tsx @@ -70,12 +70,15 @@ const SearchForm = ({ query.push(`offset=${offset}`); } - const request = new Request(`https://sertifikaattilukija.herokuapp.com/data?${query.join('&')}`, { - method: 'GET', - headers: new Headers({ - 'Content-Type': 'application/json', - }), - }); + const request = new Request( + `https://sertifikaattilukija.herokuapp.com/data?${query.join('&')}`, + { + method: 'GET', + headers: new Headers({ + 'Content-Type': 'application/json', + }), + } + ); const result = await fetch(request); const { data, totalResults, resultsFrom } = await result.json(); diff --git a/pages/404.tsx b/pages/404.tsx index d862645..916b9df 100644 --- a/pages/404.tsx +++ b/pages/404.tsx @@ -5,22 +5,27 @@ import { Button, Grid, Typography, Link as MuiLink } from '@mui/material'; const Custom404 = () => { return (
- - - - 404 - - - + + + 404 + + - Sivua ei löytynyt + Sivua ei löytynyt - - + + - + - +
); diff --git a/pages/[id].tsx b/pages/[id].tsx index a137c65..7cd9715 100644 --- a/pages/[id].tsx +++ b/pages/[id].tsx @@ -67,7 +67,9 @@ const CompanyResult = ({ company }: { company: Company }) => {
Ovatko yrityksen tiedot virheelliset? Ota yhteyttä osoitteeseen{' '} - virpi.aittokoski (at) businessfinland.fi + + virpi.aittokoski (at) businessfinland.fi + );