@@ -2,9 +2,9 @@ import { useRef, useState, useEffect } from 'react';
22import { Modal , StyleSheet , Text , View } from 'react-native' ;
33import { TrueSheet , TrueSheetProvider } from '@lodev09/react-native-true-sheet' ;
44
5- import { BLUE , DARK , DARK_BLUE , DARK_GRAY , GAP , LIGHT_GRAY , SPACING } from '../utils' ;
6- import { Button , DemoContent , Input , Spacer } from '../components' ;
7- import { PromptSheet , FlatListSheet } from '../components/sheets' ;
5+ import { BLUE , DARK_GRAY , GAP , LIGHT_GRAY , SPACING } from '../utils' ;
6+ import { Button , Input , Spacer } from '../components' ;
7+ import { PromptSheet , FlatListSheet , ScrollViewSheet } from '../components/sheets' ;
88
99export interface ModalScreenProps {
1010 onNavigateToTest ?: ( ) => void ;
@@ -16,12 +16,13 @@ export const ModalScreen = ({ onNavigateToTest, onDismiss }: ModalScreenProps) =
1616 const flatlistSheet = useRef < TrueSheet > ( null ) ;
1717
1818 const [ modalVisible , setModalVisible ] = useState ( false ) ;
19- const modalSimpleSheet = useRef < TrueSheet > ( null ) ;
19+ const modalPromptSheet = useRef < TrueSheet > ( null ) ;
2020 const modalFlatlistSheet = useRef < TrueSheet > ( null ) ;
21+ const modalScrollViewSheet = useRef < TrueSheet > ( null ) ;
2122
2223 useEffect ( ( ) => {
2324 if ( modalVisible ) {
24- modalSimpleSheet . current ?. present ( ) ;
25+ modalPromptSheet . current ?. present ( ) ;
2526 }
2627 } , [ modalVisible ] ) ;
2728
@@ -58,23 +59,18 @@ export const ModalScreen = ({ onNavigateToTest, onDismiss }: ModalScreenProps) =
5859 This is a React Native Modal. You can present TrueSheets from here!
5960 </ Text >
6061 </ View >
61- < Button text = "Simple Sheet" onPress = { ( ) => modalSimpleSheet . current ?. present ( ) } />
62+ < Button text = "Prompt Sheet" onPress = { ( ) => modalPromptSheet . current ?. present ( ) } />
63+ < Button
64+ text = "ScrollView Sheet"
65+ onPress = { ( ) => modalScrollViewSheet . current ?. present ( ) }
66+ />
6267 < Button text = "FlatList Sheet" onPress = { ( ) => modalFlatlistSheet . current ?. present ( ) } />
6368 < Spacer />
6469 < Button text = "Close Modal" onPress = { ( ) => setModalVisible ( false ) } />
6570
66- < TrueSheet
67- ref = { modalSimpleSheet }
68- detents = { [ 'auto' ] }
69- // initialDetentIndex={0}
70- dimmed = { false }
71- style = { styles . simpleSheet }
72- backgroundColor = { DARK }
73- >
74- < DemoContent color = { DARK_BLUE } text = "Simple Sheet" />
75- < Button text = "Dismiss" onPress = { ( ) => modalSimpleSheet . current ?. dismiss ( ) } />
76- </ TrueSheet >
71+ < PromptSheet ref = { modalPromptSheet } />
7772 < FlatListSheet ref = { modalFlatlistSheet } />
73+ < ScrollViewSheet ref = { modalScrollViewSheet } />
7874 </ View >
7975 </ TrueSheetProvider >
8076 </ Modal >
@@ -98,10 +94,6 @@ const styles = StyleSheet.create({
9894 padding : SPACING ,
9995 gap : GAP ,
10096 } ,
101- simpleSheet : {
102- padding : SPACING ,
103- gap : GAP ,
104- } ,
10597 heading : {
10698 marginBottom : SPACING * 2 ,
10799 } ,
0 commit comments