summaryrefslogtreecommitdiff
path: root/storybook/views/story-screen.tsx
blob: 1e59efdb124730fec6c2062556ee5b53c0ab0c52 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import * as React from 'react'
import { ViewStyle, KeyboardAvoidingView, Platform } from 'react-native'

const ROOT: ViewStyle = { backgroundColor: '#f0f0f0', flex: 1 }

export interface StoryScreenProps {
  children?: React.ReactNode
}

const behavior = Platform.OS === 'ios' ? 'padding' : undefined
export const StoryScreen = (props: StoryScreenProps) => (
  <KeyboardAvoidingView
    style={ROOT}
    behavior={behavior}
    keyboardVerticalOffset={50}
  >
    {props.children}
  </KeyboardAvoidingView>
)