Skip to content

Commit

Permalink
💫 Update: Ex - ModalSheetViewTest01
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Sep 27, 2024
1 parent 427af51 commit 20fc559
Showing 1 changed file with 67 additions and 0 deletions.
67 changes: 67 additions & 0 deletions example/src/examples/ModalSheetViewTest01.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import { ModalSheetView, ModalSheetViewMainContent, type ModalSheetViewRef } fro
import type { ExampleItemProps } from './SharedExampleTypes';
import type { ModalMetrics } from '../../../src/types/ModalMetrics';

let shouldEnableModalEventsLogging = false;

export function ModalSheetViewTest01(props: ExampleItemProps) {
const modalSheetViewRef = React.useRef<ModalSheetViewRef | null>(null);
Expand Down Expand Up @@ -136,6 +137,72 @@ export function ModalSheetViewTest01(props: ExampleItemProps) {
</React.Fragment>
<ModalSheetView
ref={ref => modalSheetViewRef.current = ref}
onModalWillPresent={({nativeEvent}) => {
if(!shouldEnableModalEventsLogging) {
return;
};

console.log(
"ModalSheetViewTest01.onModalWillPresent",
"\n - nativeEvent:", nativeEvent,
"\n"
);
}}
onModalDidPresent={({nativeEvent}) => {
if(!shouldEnableModalEventsLogging) {
return;
};

console.log(
"ModalSheetViewTest01.onModalDidPresent",
"\n - nativeEvent:", nativeEvent,
"\n"
);
}}
onModalWillShow={({nativeEvent}) => {
if(!shouldEnableModalEventsLogging) {
return;
};

console.log(
"ModalSheetViewTest01.onModalWillShow",
"\n - nativeEvent:", nativeEvent,
"\n"
);
}}
onModalDidShow={({nativeEvent}) => {
if(!shouldEnableModalEventsLogging) {
return;
};

console.log(
"ModalSheetViewTest01.onModalDidShow",
"\n - nativeEvent:", nativeEvent,
"\n"
);
}}
onModalWillHide={({nativeEvent}) => {
if(!shouldEnableModalEventsLogging) {
return;
};

console.log(
"ModalSheetViewTest01.onModalWillHide",
"\n - nativeEvent:", nativeEvent,
"\n"
);
}}
onModalDidHide={({nativeEvent}) => {
if(!shouldEnableModalEventsLogging) {
return;
};

console.log(
"ModalSheetViewTest01.onModalDidHide",
"\n - nativeEvent:", nativeEvent,
"\n"
);
}}
>
<ModalSheetViewMainContent
contentContainerStyle={styles.modalContent}
Expand Down

0 comments on commit 20fc559

Please sign in to comment.