File tree Expand file tree Collapse file tree 2 files changed +14
-8
lines changed
Expand file tree Collapse file tree 2 files changed +14
-8
lines changed Original file line number Diff line number Diff line change 1- import { Host } from "@expo/ui/swift-ui" ;
1+ import { Host as AndroidHost } from "@expo/ui/jetpack-compose" ;
2+ import { Host as IosHost } from "@expo/ui/swift-ui" ;
23import { requireNativeView } from "expo" ;
3- import { StyleSheet } from "react-native" ;
4+ import { Platform , StyleSheet } from "react-native" ;
45
56import { BibleReference } from "../types" ;
67
78const NativeView : React . ComponentType < NativeProps > =
89 requireNativeView ( "BibleReaderView" ) ;
910
11+ const PlatformHost = Platform . OS === "ios" ? IosHost : AndroidHost ;
12+
1013/**
1114 * A full-featured Bible reader component.
1215 * It allows the user to control font customizations, switch Bible versions and access their verse highlights.
@@ -15,13 +18,13 @@ const NativeView: React.ComponentType<NativeProps> =
1518 */
1619export function BibleReaderView ( { reference, ...props } : BibleReaderViewProps ) {
1720 return (
18- < Host style = { styles . view } >
21+ < PlatformHost style = { styles . view } >
1922 < NativeView
2023 hasReference = { ! ! reference }
2124 { ...( reference || { } ) }
2225 { ...props }
2326 />
24- </ Host >
27+ </ PlatformHost >
2528 ) ;
2629}
2730
Original file line number Diff line number Diff line change 1- import { CommonViewModifierProps , Host } from "@expo/ui/swift-ui" ;
1+ import { Host as AndroidHost } from "@expo/ui/jetpack-compose" ;
2+ import { CommonViewModifierProps , Host as IosHost } from "@expo/ui/swift-ui" ;
23import { fixedSize } from "@expo/ui/swift-ui/modifiers" ;
34import { requireNativeView } from "expo" ;
4- import { StyleProp , ViewStyle } from "react-native" ;
5+ import { Platform , StyleProp , ViewStyle } from "react-native" ;
6+
7+ const PlatformHost = Platform . OS === "ios" ? IosHost : AndroidHost ;
58
69const NativeView : React . ComponentType < NativeProps > = requireNativeView (
710 "SignInWithYouVersionButton" ,
@@ -61,7 +64,7 @@ export function SignInWithYouVersionButton({
6164 ...props
6265} : SignInWithYouVersionButtonProps ) {
6366 return (
64- < Host matchContents = { { vertical : true , horizontal : true } } style = { style } >
67+ < PlatformHost matchContents style = { style } >
6568 < NativeView
6669 { ...props }
6770 mode = { mode }
@@ -71,6 +74,6 @@ export function SignInWithYouVersionButton({
7174 onTap = { onPress }
7275 modifiers = { [ fixedSize ( ) ] }
7376 />
74- </ Host >
77+ </ PlatformHost >
7578 ) ;
7679}
You can’t perform that action at this time.
0 commit comments