Skip to content

Commit

Permalink
feat(event): Add default event
Browse files Browse the repository at this point in the history
  • Loading branch information
1ilsang committed Aug 19, 2023
1 parent 4c59d78 commit e148def
Show file tree
Hide file tree
Showing 5 changed files with 31 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/features/app/Router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import SettingContainer from '../setting/Container';
import ErrorContainer from '../shared/error/Container';
import NotFound from '../shared/error/notfound/NotFound';
import PreviewContainer from '../preview/Container';
import EventContainer from '../event/Container';

const router = createRoutesFromElements(
<Route
Expand All @@ -27,6 +28,7 @@ const router = createRoutesFromElements(
<Route path="login" element={<LoginContainer />} />
<Route path="setting" element={<SettingContainer />} />
<Route path="preview" element={<PreviewContainer />} />
<Route path="event" element={<EventContainer />} />
<Route path="*" element={<NotFound />} />
</Route>,
);
Expand Down
10 changes: 10 additions & 0 deletions src/features/event/Container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import { FunctionComponent } from 'react';

import useEventContainer from './hooks/useEventContainer';

const EventContainer: FunctionComponent = () => {
useEventContainer();
return <div></div>;
};

export default EventContainer;
14 changes: 14 additions & 0 deletions src/features/event/hooks/useEventContainer.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import { useAtom } from 'jotai';
import { useLayoutEffect } from 'react';

import { titleAtom } from '../../shared/layout/atom';

const useEventContainer = () => {
const [, setTitle] = useAtom(titleAtom);

useLayoutEffect(() => {
setTitle({ back: true, title: 'Event' });
}, []);
};

export default useEventContainer;
2 changes: 1 addition & 1 deletion src/features/shared/layout/components/Title.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const LayoutTitle: FunctionComponent = () => {

return (
<div className="layout-title under-line">
<div className="left">
<div className={`left ${back ? 'has' : ''}`}>
{back && (
<img src={backLogo} alt="Back Logo" onClick={handleBackClick} />
)}
Expand Down
4 changes: 4 additions & 0 deletions src/features/shared/layout/layout.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
display: flex;
align-items: center;
justify-content: center;

&.has {
cursor: pointer;
}
}

.title {
Expand Down

0 comments on commit e148def

Please sign in to comment.