Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions apps/tax/components/Error/CustomError/CustomError.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
import {
GridContainer,
GridRow,
GridColumn,
Box,
Text,
} from '@island.is/island-ui/core'
import { ReactNode } from 'react'

interface CustomErrorProps {
statusCode: number
title: string
children: ReactNode
}

const CustomError = ({ statusCode, title, children }: CustomErrorProps) => {
return (
<GridContainer>
<GridRow>
<GridColumn span={'12/12'} paddingBottom={10} paddingTop={8}>
<Box
display="flex"
flexDirection="column"
width="full"
alignItems="center"
>
<Text
variant="eyebrow"
as="div"
paddingBottom={2}
color="purple400"
>
{statusCode}
</Text>
<Text variant="h1" as="h1" paddingBottom={3}>
{title}
</Text>
{children}
</Box>
</GridColumn>
</GridRow>
</GridContainer>
)
}

export default CustomError
15 changes: 15 additions & 0 deletions apps/tax/components/Error/Error404/Error404.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"Error404": {
"title": "Afsakið hlé.",
"notFoundText": "Síða eða skjal fannst ekki.",
"text": "Eftirfarandi ástæður geta verið fyrir því að síða/skjal fannst ekki",
"bulletOne": "Upplýsingar hafa verið fjarlægðar",
"bulletTwo": "Vefslóð er ekki rétt skrifuð",
"bulletThree": "Síðan er ekki lengur til",
"bulletFour": "Villa er á síðunni",
"textAfterBullets": "Þú getur einnig prófað að leita að efninu á forsíðu",
"linkText": "samráðsgáttarinnar",
"textAfterBreak": "Teljir þú að síða eða skjal eigi sannarlega að birtast má endilega senda ábendingu á netfangið ",
"email": "samradsgatt@stjornarradid.is"
}
}
37 changes: 37 additions & 0 deletions apps/tax/components/Error/Error404/Error404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
import {Bullet, BulletList, LinkV2, Text} from '@island.is/island-ui/core'
import Link from 'next/link'
import localization from './Error404.json'
import {CustomError} from "@island.is/tax/components/Error";
import Layout from "@island.is/tax/layouts/main";

export const Error404 = () => {
const loc = localization.Error404
return (
<CustomError statusCode={404} title={loc.title}>
<Text as="h2" variant="h5" paddingBottom={3}>
{loc.notFoundText}
</Text>
<div>
<Text>{`${loc.text}:`}</Text>
<BulletList>
<Bullet>{loc.bulletOne}</Bullet>
<Bullet>{loc.bulletTwo}</Bullet>
<Bullet>{loc.bulletThree}</Bullet>
<Bullet>{loc.bulletFour}</Bullet>
</BulletList>{' '}
<Text>
{loc.textAfterBullets}
<Link href="https://island.is/samradsgatt" legacyBehavior>
{loc.linkText}
</Link>
<br/>
{loc.textAfterBreak}
<LinkV2 href="mailto:samradsgatt@stjornarradid.is">
{loc.email}
</LinkV2>
</Text>
</div>
</CustomError>
)
}
export default Error404
6 changes: 6 additions & 0 deletions apps/tax/components/Error/Error500/Error500.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"Error500": {
"title": "Afsakið hlé",
"text": "Eitthvað fór úrskeiðis. Villan hefur verið skráð og unnið verður að viðgerð eins fljótt og auðið er."
}
}
13 changes: 13 additions & 0 deletions apps/tax/components/Error/Error500/Error500.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { Text } from '@island.is/island-ui/core'
import localization from './Error500.json'
import {CustomError} from "@island.is/tax/components/Error";

export const Error500 = () => {
const loc = localization.Error500
return (
<CustomError statusCode={500} title={loc.title}>
<Text>{loc.text}</Text>
</CustomError>
)
}
export default Error500
3 changes: 3 additions & 0 deletions apps/tax/components/Error/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export { default as Error404 } from './Error404/Error404'
export { default as Error500 } from './Error500/Error500'
export { default as CustomError } from './CustomError/CustomError'
8 changes: 8 additions & 0 deletions apps/tax/pages/404.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import {Error404} from "@island.is/tax/components/Error";


export const Index = () => {
return <Error404 />
}

export default Index
Loading