File tree Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Expand file tree Collapse file tree 2 files changed +43
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { Meta , StoryObj } from '@storybook/react' ;
2
+ import AppBar from './AppBar' ;
3
+ import { BrowserRouter } from 'react-router-dom' ;
4
+
5
+ const meta : Meta < typeof AppBar > = {
6
+ title : 'AppBar' ,
7
+ component : AppBar ,
8
+ render : ( args ) => (
9
+ < BrowserRouter >
10
+ < AppBar { ...args } />
11
+ </ BrowserRouter >
12
+ ) ,
13
+ } ;
14
+
15
+ export default meta ;
16
+
17
+ export type story = StoryObj < typeof AppBar > ;
18
+
19
+ export const Default : story = {
20
+ args : {
21
+ title : '모임 일정 등록하기' ,
22
+ backButton : true ,
23
+ } ,
24
+ } ;
Original file line number Diff line number Diff line change
1
+ import { FC } from 'react' ;
2
+ import HistoryBackButton from './HistoryBackButton' ;
3
+
4
+ interface AppBarProps {
5
+ title ?: string ;
6
+ backButton ?: boolean ;
7
+ }
8
+
9
+ const AppBar : FC < AppBarProps > = ( { title = '' , backButton = true } ) => {
10
+ return (
11
+ < nav className = "grid grid-cols-5 py-5" >
12
+ < div className = "col-span-1" > { backButton ? < HistoryBackButton /> : < span /> } </ div >
13
+ < h1 className = "col-span-3 text-center" > { title } </ h1 >
14
+ < span className = "col-span-1" />
15
+ </ nav >
16
+ ) ;
17
+ } ;
18
+
19
+ export default AppBar ;
You can’t perform that action at this time.
0 commit comments