summaryrefslogtreecommitdiff
path: root/app/components/screen/screen.tsx
diff options
context:
space:
mode:
authorKirill Rogovoy <[email protected]>2021-07-19 20:06:08 +0300
committerKirill Rogovoy <[email protected]>2021-07-19 20:06:08 +0300
commitf0bf4e7afdcd8b02a62be45ab3e7d047ed865a79 (patch)
tree575c0ff2cbb846252bd2e494c81c396846aab2f6 /app/components/screen/screen.tsx
parent67ad38d0a7cd319623e9f41c0c381ed5c5f6f973 (diff)
Apply Prettier
Diffstat (limited to 'app/components/screen/screen.tsx')
-rw-r--r--app/components/screen/screen.tsx42
1 files changed, 27 insertions, 15 deletions
diff --git a/app/components/screen/screen.tsx b/app/components/screen/screen.tsx
index ba84547..e593dde 100644
--- a/app/components/screen/screen.tsx
+++ b/app/components/screen/screen.tsx
@@ -1,25 +1,33 @@
-import * as React from "react"
-import { KeyboardAvoidingView, Platform, ScrollView, StatusBar, View } from "react-native"
-import { useSafeAreaInsets } from "react-native-safe-area-context"
-import { ScreenProps } from "./screen.props"
-import { isNonScrolling, offsets, presets } from "./screen.presets"
+import * as React from 'react'
+import {
+ KeyboardAvoidingView,
+ Platform,
+ ScrollView,
+ StatusBar,
+ View,
+} from 'react-native'
+import { useSafeAreaInsets } from 'react-native-safe-area-context'
+import { ScreenProps } from './screen.props'
+import { isNonScrolling, offsets, presets } from './screen.presets'
-const isIos = Platform.OS === "ios"
+const isIos = Platform.OS === 'ios'
function ScreenWithoutScrolling(props: ScreenProps) {
const insets = useSafeAreaInsets()
const preset = presets.fixed
const style = props.style || {}
- const backgroundStyle = props.backgroundColor ? { backgroundColor: props.backgroundColor } : {}
+ const backgroundStyle = props.backgroundColor
+ ? { backgroundColor: props.backgroundColor }
+ : {}
const insetStyle = { paddingTop: props.unsafe ? 0 : insets.top }
return (
<KeyboardAvoidingView
style={[preset.outer, backgroundStyle]}
- behavior={isIos ? "padding" : undefined}
- keyboardVerticalOffset={offsets[props.keyboardOffset || "none"]}
+ behavior={isIos ? 'padding' : undefined}
+ keyboardVerticalOffset={offsets[props.keyboardOffset || 'none']}
>
- <StatusBar barStyle={props.statusBar || "light-content"} />
+ <StatusBar barStyle={props.statusBar || 'light-content'} />
<View style={[preset.inner, style, insetStyle]}>{props.children}</View>
</KeyboardAvoidingView>
)
@@ -29,21 +37,25 @@ function ScreenWithScrolling(props: ScreenProps) {
const insets = useSafeAreaInsets()
const preset = presets.scroll
const style = props.style || {}
- const backgroundStyle = props.backgroundColor ? { backgroundColor: props.backgroundColor } : {}
+ const backgroundStyle = props.backgroundColor
+ ? { backgroundColor: props.backgroundColor }
+ : {}
const insetStyle = { paddingTop: props.unsafe ? 0 : insets.top }
return (
<KeyboardAvoidingView
style={[preset.outer, backgroundStyle]}
- behavior={isIos ? "padding" : undefined}
- keyboardVerticalOffset={offsets[props.keyboardOffset || "none"]}
+ behavior={isIos ? 'padding' : undefined}
+ keyboardVerticalOffset={offsets[props.keyboardOffset || 'none']}
>
- <StatusBar barStyle={props.statusBar || "light-content"} />
+ <StatusBar barStyle={props.statusBar || 'light-content'} />
<View style={[preset.outer, backgroundStyle, insetStyle]}>
<ScrollView
style={[preset.outer, backgroundStyle]}
contentContainerStyle={[preset.inner, style]}
- keyboardShouldPersistTaps={props.keyboardShouldPersistTaps || "handled"}
+ keyboardShouldPersistTaps={
+ props.keyboardShouldPersistTaps || 'handled'
+ }
>
{props.children}
</ScrollView>