From b643c2f8d2f8c9612ee014ecb266799295b55df8 Mon Sep 17 00:00:00 2001 From: Kacper Kafara Date: Fri, 7 Jul 2023 09:32:07 +0200 Subject: [PATCH] Reformat part of test examples in TestsExample app --- TestsExample/src/Test1031.tsx | 38 ++++++++---- TestsExample/src/Test1032.tsx | 5 +- TestsExample/src/Test1036.tsx | 6 +- TestsExample/src/Test1072.tsx | 18 +++--- TestsExample/src/Test1084.tsx | 10 +++- TestsExample/src/Test1096.tsx | 15 ++--- TestsExample/src/Test1097.tsx | 22 ++++--- TestsExample/src/Test111.js | 3 +- TestsExample/src/Test1153.tsx | 2 +- TestsExample/src/Test1162.tsx | 5 +- TestsExample/src/Test1190.tsx | 42 ++++++++++---- TestsExample/src/Test1214.tsx | 33 +++++++---- TestsExample/src/Test1228.tsx | 25 ++++---- TestsExample/src/Test1260.tsx | 33 +++++++---- TestsExample/src/Test1296.tsx | 43 ++++++++------ TestsExample/src/Test1299.tsx | 37 ++++++------ TestsExample/src/Test1391.tsx | 28 ++++----- TestsExample/src/Test1419.tsx | 72 +++++++++++++---------- TestsExample/src/Test1473.tsx | 23 +++++--- TestsExample/src/Test1476.tsx | 105 ++++++++++++++++++++-------------- 20 files changed, 344 insertions(+), 221 deletions(-) diff --git a/TestsExample/src/Test1031.tsx b/TestsExample/src/Test1031.tsx index 74a874dfc0..c74b5a6567 100644 --- a/TestsExample/src/Test1031.tsx +++ b/TestsExample/src/Test1031.tsx @@ -1,36 +1,50 @@ import * as React from 'react'; import {Button} from 'react-native'; import {NavigationContainer, ParamListBase} from '@react-navigation/native'; -import {createNativeStackNavigator, NativeStackNavigationProp, useHeaderHeight} from 'react-native-screens/native-stack'; +import { + createNativeStackNavigator, + NativeStackNavigationProp, + useHeaderHeight, +} from 'react-native-screens/native-stack'; const Stack = createNativeStackNavigator(); export default function App() { return ( - + - + ); } -function First({navigation}: {navigation: NativeStackNavigationProp}) { +function First({ + navigation, +}: { + navigation: NativeStackNavigationProp; +}) { console.log(useHeaderHeight()); return ( - + }} + /> ); }; @@ -27,26 +31,33 @@ const Home = ({navigation}: Props) => { const Details = () => { return ( - + ); }; const App = () => { return ( - - JS Navigation + + + JS Navigation + - - + + - Native Navigation + + Native Navigation + - - + + diff --git a/TestsExample/src/Test1228.tsx b/TestsExample/src/Test1228.tsx index 298d44bb25..898a116018 100644 --- a/TestsExample/src/Test1228.tsx +++ b/TestsExample/src/Test1228.tsx @@ -1,14 +1,13 @@ -import React, { useState, useEffect } from 'react'; -import { Text, View, StyleSheet, Button } from 'react-native'; +import React, {useState, useEffect} from 'react'; +import {Text, View, StyleSheet, Button} from 'react-native'; import { useNavigation, NavigationContainer, DefaultTheme, DarkTheme, } from '@react-navigation/native'; -import { SafeAreaProvider } from 'react-native-safe-area-context'; -import { createNativeStackNavigator } from 'react-native-screens/native-stack'; - +import {SafeAreaProvider} from 'react-native-safe-area-context'; +import {createNativeStackNavigator} from 'react-native-screens/native-stack'; export const FirstScreen = () => { const [theme, setTheme] = useState(false); @@ -17,7 +16,7 @@ export const FirstScreen = () => { useEffect(() => { navigation.setOptions({ headerTitle: theme ? 'red' : 'green', - }) + }); }); return ( @@ -36,7 +35,7 @@ export const SecondScreen = () => { useEffect(() => { navigation.setOptions({ headerTitle: theme ? 'red' : 'green', - }) + }); }); return ( @@ -57,12 +56,14 @@ export default function App() { return ( - - + + - + diff --git a/TestsExample/src/Test1260.tsx b/TestsExample/src/Test1260.tsx index a98cc7c965..bd6a2a26e3 100644 --- a/TestsExample/src/Test1260.tsx +++ b/TestsExample/src/Test1260.tsx @@ -1,7 +1,10 @@ import * as React from 'react'; import {Button, View} from 'react-native'; import {NavigationContainer, ParamListBase} from '@react-navigation/native'; -import {createNativeStackNavigator, NativeStackNavigationProp} from 'react-native-screens/native-stack'; +import { + createNativeStackNavigator, + NativeStackNavigationProp, +} from 'react-native-screens/native-stack'; const Stack = createNativeStackNavigator(); @@ -10,28 +13,38 @@ export default function App() { - + ); } -function First({navigation}: {navigation: NativeStackNavigationProp}) { +function First({ + navigation, +}: { + navigation: NativeStackNavigationProp; +}) { return ( -