-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
💫 Update: Ex -
ModalSheetViewTest04
Scaffolding
- Loading branch information
1 parent
624fb46
commit 43ed0af
Showing
3 changed files
with
88 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,82 @@ | ||
/* eslint-disable react-hooks/exhaustive-deps */ | ||
import * as React from 'react'; | ||
import { StyleSheet, Text, View } from 'react-native'; | ||
|
||
import { ExampleItemCard, CardButton, Colors } from 'react-native-ios-utilities'; | ||
import { ModalSheetView, ModalSheetViewContext, ModalSheetMainContent, type ModalSheetViewRef, ModalSheetViewBottomAttachedContentOverlay } from 'react-native-ios-modal'; | ||
|
||
import type { ExampleItemProps } from './SharedExampleTypes'; | ||
|
||
|
||
export function ModalSheetViewTest04(props: ExampleItemProps) { | ||
const modalSheetViewRef = React.useRef<ModalSheetViewRef | null>(null); | ||
const modalContext = React.useContext(ModalSheetViewContext); | ||
|
||
|
||
return ( | ||
<ExampleItemCard | ||
style={props.style} | ||
index={props.index} | ||
title={'ModalSheetViewTest04'} | ||
description={[ | ||
"TBA", | ||
]} | ||
> | ||
<CardButton | ||
title={'Present Sheet Modal'} | ||
subtitle={'Present content as sheet'} | ||
onPress={async () => { | ||
await modalSheetViewRef.current?.presentModal(); | ||
}} | ||
/> | ||
<ModalSheetView | ||
ref={ref => modalSheetViewRef.current = ref} | ||
> | ||
<ModalSheetMainContent | ||
contentContainerStyle={styles.modalContent} | ||
> | ||
<View style={styles.modalContentDummy}> | ||
<Text style={styles.modalContentDummyLabel}> | ||
{'Main Content'} | ||
</Text> | ||
</View> | ||
</ModalSheetMainContent> | ||
<ModalSheetViewBottomAttachedContentOverlay | ||
contentContainerStyle={styles.modalBottomOverlayContent} | ||
> | ||
<View style={styles.bottomContentDummy}> | ||
<Text> | ||
{'Bottom Content'} | ||
</Text> | ||
</View> | ||
</ModalSheetViewBottomAttachedContentOverlay> | ||
</ModalSheetView> | ||
</ExampleItemCard> | ||
); | ||
}; | ||
|
||
const styles = StyleSheet.create({ | ||
debugDisplayInner: { | ||
backgroundColor: `${Colors.PURPLE[200]}99`, | ||
}, | ||
modalContent: { | ||
flex: 1, | ||
alignItems: 'center', | ||
justifyContent: 'center', | ||
paddingHorizontal: 12, | ||
paddingVertical: 24, | ||
}, | ||
modalContentDummy: { | ||
padding: 32, | ||
backgroundColor: Colors.PURPLE[100], | ||
borderRadius: 12, | ||
}, | ||
modalContentDummyLabel: { | ||
fontSize: 16, | ||
}, | ||
modalBottomOverlayContent: { | ||
backgroundColor: Colors.PURPLE[100], | ||
}, | ||
bottomContentDummy: { | ||
}, | ||
}); |