Skip to content

Commit

Permalink
feat: add error page
Browse files Browse the repository at this point in the history
  • Loading branch information
ooooorobo committed Sep 29, 2024
1 parent cba3ad2 commit 54c50b7
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/client/renderer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { App } from './view/App';
import { NotFoundPage } from './view/pages/404';
import { ExpiredPage } from './view/pages/expired';
import { Platform } from '../server/types/platform';
import { ErrorPage } from './view/pages/error';

const defaultHtml = (assetPath: string, content: string) => `
<!DOCTYPE html>
Expand Down Expand Up @@ -67,3 +68,8 @@ export const renderExpired = (props: AppProps) => {
const content = renderToStaticMarkup(<ExpiredPage {...props} />);
return defaultHtml(props.assetPath, content);
};

export const renderError = (props: AppProps) => {
const content = renderToStaticMarkup(<ErrorPage {...props} />);
return defaultHtml(props.assetPath, content);
};
31 changes: 31 additions & 0 deletions src/client/view/pages/error/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import React from 'react';
import { WarningTemplate } from '../../components/template/WarningTemplate';
import { DefaultContainer } from '../../components/_common/DefaultContainer';
import { css } from '@linaria/core';
import { AppProps } from '../../types/app';
import { AppDownload } from '../../components/banner/AppDownload';
import { useShowAppDownloadBanner } from '../../components/banner/useShowAppDownloadBanner';

export const ErrorPage = (props: AppProps) => {
const showDownloadBanner = useShowAppDownloadBanner();
return (
<DefaultContainer {...props}>
<div className={container}>
{showDownloadBanner && <AppDownload />}
<WarningTemplate
iconName={'warning'}
title={'์—๋Ÿฌ๊ฐ€ ๋ฐœ์ƒํ–ˆ์–ด์š”'}
iconSize={53}
/>
</div>
</DefaultContainer>
);
};

const container = css`
height: 100dvh;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
`;

0 comments on commit 54c50b7

Please sign in to comment.