From 13628580c373669ca14c3cc33e53e0492b0f4096 Mon Sep 17 00:00:00 2001 From: Kacper Kafara Date: Wed, 20 Nov 2024 17:09:28 +0100 Subject: [PATCH] chore: make formsheet work in Example app (#2528) ## Description Fixed #2521 ## Changes Separated the formsheet and card components and applied correct styles for formsheet. ## Test code and steps to reproduce Just use the `StackPresentation` screen in example app. ## Checklist - [x] Included code example that can be used to test this change - [x] Ensured that CI passes --- apps/src/screens/StackPresentation.tsx | 41 +++++++++++++++++++++----- 1 file changed, 33 insertions(+), 8 deletions(-) diff --git a/apps/src/screens/StackPresentation.tsx b/apps/src/screens/StackPresentation.tsx index fa25ba000c..5773e029cd 100644 --- a/apps/src/screens/StackPresentation.tsx +++ b/apps/src/screens/StackPresentation.tsx @@ -1,6 +1,6 @@ import React from 'react'; import { ScrollView, StyleSheet, View, ImageBackground } from 'react-native'; -import { ParamListBase } from '@react-navigation/native'; +import { ParamListBase, RouteProp } from '@react-navigation/native'; import { createNativeStackNavigator, NativeStackNavigationProp, @@ -15,7 +15,7 @@ type StackParamList = { ContainedModal: undefined; ContainedTransparentModal: undefined; FullScreenModal: undefined; - FormSheet: undefined; + FormSheet: { usesFormSheetPresentation?: boolean }; }; interface MainScreenProps { @@ -71,21 +71,43 @@ const MainScreen = ({ navigation }: MainScreenProps): React.JSX.Element => { ); }; -interface FormScreenProps { - navigation: NativeStackNavigationProp; +interface PushScreenProps { + navigation: NativeStackNavigationProp; } -const FormScreen = ({ navigation }: FormScreenProps): React.JSX.Element => ( +const PushScreen = ({ navigation }: PushScreenProps) => ( + + +) + +interface FormScreenProps { + navigation: NativeStackNavigationProp; + route: RouteProp; +} + +const FormScreenContent = ({ navigation }: { navigation: NativeStackNavigationProp }) => ( + <>