Skip to content

Commit

Permalink
Merge pull request #974 from 42organization/GGFE-228-에러페이지-이모지-변경
Browse files Browse the repository at this point in the history
[GGFE-228] 에러페이지 이모지 수정 +  스토리북 추가
  • Loading branch information
yoouyeon authored Sep 5, 2023
2 parents 386b088 + c29a60a commit 1e1355a
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 4 deletions.
3 changes: 1 addition & 2 deletions components/error/Error.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import React from 'react';
import ErrorEmoji from 'public/image/noti_empty.svg';
import useErrorPage from 'hooks/error/useErrorPage';
import styles from 'styles/Error.module.scss';
import ErrorEmoji from '/public/image/error_face.svg';

export default function ErrorPage() {
const { error, goHome } = useErrorPage();
Expand Down
2 changes: 1 addition & 1 deletion hooks/error/useErrorPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { useEffect } from 'react';
import { useRecoilState } from 'recoil';
import { errorState } from 'utils/recoil/error';

export const useErrorPage = () => {
const useErrorPage = () => {
const [error, setError] = useRecoilState(errorState);
const router = useRouter();

Expand Down
2 changes: 2 additions & 0 deletions public/image/error_face.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion public/image/noti_empty.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
30 changes: 30 additions & 0 deletions stories/error.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import { useEffect } from 'react';
import { useSetRecoilState } from 'recoil';
import type { Meta, StoryObj } from '@storybook/react';
import { errorState } from 'utils/recoil/error';
import ErrorPage from 'components/error/Error';

const meta: Meta = {
title: '/ErrorPage',
component: ErrorPage,
};

export default meta;
type Story = StoryObj<typeof ErrorPage>;

function useSetError() {
const setError = useSetRecoilState(errorState);

useEffect(() => {
setError('HJ00');
}, []);
}

const ErrorDefault = () => {
useSetError();
return <ErrorPage />;
};

export const Default: Story = {
render: () => <ErrorDefault />,
};

0 comments on commit 1e1355a

Please sign in to comment.