Skip to content

Commit

Permalink
💫 Update: Ex - Test08
Browse files Browse the repository at this point in the history
  • Loading branch information
dominicstop committed Apr 22, 2023
1 parent fe633b6 commit 4a03694
Showing 1 changed file with 32 additions and 7 deletions.
39 changes: 32 additions & 7 deletions example/src/examples/Test08.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,58 @@ import { ExampleCard } from '../components/ExampleCard';
import { CardBody, CardButton, CardTitle } from '../components/Card';

import { ModalView } from 'react-native-ios-modal';
import { ObjectPropertyDisplay } from '../components/ObjectPropertyDisplay';

export function Test08(props: ExampleProps) {
const modalRef = React.useRef<ModalView>(null);

const [counter, setCounter] = React.useState(0);
const [shouldUseMediumDetent, setShouldUseMediumDetent] =
React.useState(true);

const [debugObject, setDebugObject] = React.useState({
detentCurrent: null,
detentPrev: null,
});

return (
<ExampleCard
style={props.style}
index={props.index}
title={'Test08'}
subtitle={'test - TBA'}
description={['desc - TBA']}
subtitle={'System Sheet Detent Test'}
description={['Test for using the system-defined detents']}
>
<ModalView
// TBA
ref={modalRef}
containerStyle={styles.modalContainer}
modalSheetDetents={['medium', 'large']}
sheetPreferredCornerRadius={30}
sheetShouldAnimateChanges={true}
sheetSelectedDetentIdentifier={
shouldUseMediumDetent ? 'medium' : 'large'
}
onModalDidChangeSelectedDetentIdentifier={({ nativeEvent }) => {
setDebugObject((prev) => ({
...prev,
detentCurrent: nativeEvent.sheetDetentStringCurrent,
detentPrev: nativeEvent.sheetDetentStringPrevious,
}));
}}
>
<React.Fragment>
<CardBody style={styles.modalCard}>
<CardTitle title={'Title - TBA'} />
<CardTitle title={'System Detents Test'} />
<ObjectPropertyDisplay
object={{
shouldUseMediumDetent,
...debugObject,
}}
/>
</CardBody>
<CardButton
title={'🌼 TBA'}
title={'🌼 Change Current Detent'}
onPress={() => {
// TBA
setShouldUseMediumDetent((prevValue) => !prevValue);
}}
/>
</React.Fragment>
Expand Down

0 comments on commit 4a03694

Please sign in to comment.