summaryrefslogtreecommitdiff
path: root/app_expo/components/header/header.story.tsx
diff options
context:
space:
mode:
authorKirill Rogovoy <[email protected]>2021-07-20 21:24:52 +0300
committerKirill Rogovoy <[email protected]>2021-07-20 21:24:52 +0300
commit5f4611d65e40eae3ca6191a15f68d69ea5a1c4cb (patch)
tree273dfc086444533d86d580961c92ba8d14781a67 /app_expo/components/header/header.story.tsx
parentf0bf4e7afdcd8b02a62be45ab3e7d047ed865a79 (diff)
WIP
Diffstat (limited to 'app_expo/components/header/header.story.tsx')
-rw-r--r--app_expo/components/header/header.story.tsx43
1 files changed, 43 insertions, 0 deletions
diff --git a/app_expo/components/header/header.story.tsx b/app_expo/components/header/header.story.tsx
new file mode 100644
index 0000000..db87b89
--- /dev/null
+++ b/app_expo/components/header/header.story.tsx
@@ -0,0 +1,43 @@
+import * as React from 'react'
+import { View, Alert } from 'react-native'
+import { storiesOf } from '@storybook/react-native'
+import { StoryScreen, Story, UseCase } from '../../../storybook/views'
+import { Header } from './header'
+import { color } from '../../theme'
+
+declare let module
+
+const VIEWSTYLE = {
+ flex: 1,
+ backgroundColor: color.storybookDarkBg,
+}
+
+storiesOf('Header', module)
+ .addDecorator((fn) => <StoryScreen>{fn()}</StoryScreen>)
+ .add('Behavior', () => (
+ <Story>
+ <UseCase noPad text="default" usage="The default usage">
+ <View style={VIEWSTYLE}>
+ <Header headerTx="demoScreen.howTo" />
+ </View>
+ </UseCase>
+ <UseCase noPad text="leftIcon" usage="A left nav icon">
+ <View style={VIEWSTYLE}>
+ <Header
+ headerTx="demoScreen.howTo"
+ leftIcon="back"
+ onLeftPress={() => Alert.alert('left nav')}
+ />
+ </View>
+ </UseCase>
+ <UseCase noPad text="rightIcon" usage="A right nav icon">
+ <View style={VIEWSTYLE}>
+ <Header
+ headerTx="demoScreen.howTo"
+ rightIcon="bullet"
+ onRightPress={() => Alert.alert('right nav')}
+ />
+ </View>
+ </UseCase>
+ </Story>
+ ))