From afacf5609cf07218ada8b7e0e49797962ab7d255 Mon Sep 17 00:00:00 2001 From: Martin Salles Date: Wed, 3 Feb 2021 12:15:07 +0100 Subject: [PATCH 1/6] Use Safe Area View to make sure of editor usability on new iphones --- App.js | 11 +++++++---- src/Components/PlayEditorPage.js | 5 +++-- .../__snapshots__/PlayEditorPage.test.js.snap | 8 ++++---- 3 files changed, 14 insertions(+), 10 deletions(-) diff --git a/App.js b/App.js index 0c7a9274..200467b0 100644 --- a/App.js +++ b/App.js @@ -7,6 +7,7 @@ import { enableScreens } from 'react-native-screens'; import { Provider as ReduxProvider } from 'react-redux'; import { Provider as PaperProvider } from 'react-native-paper'; import * as Linking from 'expo-linking'; +import { SafeAreaProvider } from 'react-native-safe-area-context'; import { Navigation } from './src/Navigation'; import { store, persistor } from './src/Store/configureStore'; @@ -31,10 +32,12 @@ const App = (props) => { - Loading...}> - - - + + Loading...}> + + + + diff --git a/src/Components/PlayEditorPage.js b/src/Components/PlayEditorPage.js index 2c899c47..1a3fc2b8 100644 --- a/src/Components/PlayEditorPage.js +++ b/src/Components/PlayEditorPage.js @@ -2,6 +2,7 @@ import React, { useState, useEffect, useLayoutEffect } from 'react'; import { StyleSheet, View, TouchableOpacity } from 'react-native'; import { MaterialCommunityIcons } from '@expo/vector-icons'; import { connect } from 'react-redux'; +import { SafeAreaView } from 'react-native-safe-area-context'; import Drill from './animation/Drill'; import I18n from '../utils/i18n'; @@ -97,7 +98,7 @@ export const PlayEditorPage = (props) => { }; return ( - + {modalRenameVisible ? ( setModalRenameVisible(false)} /> @@ -128,7 +129,7 @@ export const PlayEditorPage = (props) => { - + ); }; diff --git a/src/Components/__snapshots__/PlayEditorPage.test.js.snap b/src/Components/__snapshots__/PlayEditorPage.test.js.snap index 0f03c5f1..f85b5d00 100644 --- a/src/Components/__snapshots__/PlayEditorPage.test.js.snap +++ b/src/Components/__snapshots__/PlayEditorPage.test.js.snap @@ -1,7 +1,7 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP exports[` renders correctly with a currentPlay 1`] = ` - renders correctly with a currentPlay 1`] = ` - + `; exports[` renders correctly 1`] = ` - renders correctly 1`] = ` - + `; From 241c0742edc3fff1ba680271197e4396f3f5fdf2 Mon Sep 17 00:00:00 2001 From: arribbar Date: Wed, 3 Feb 2021 21:43:00 +0100 Subject: [PATCH 2/6] Use SafeAreaView to have a better display on ios --- src/Components/DrillPageMinimal.js | 5 +- src/Components/FitnessFilters.js | 5 +- src/Components/FrisbeeFilters.js | 5 +- src/Components/PlayEditorPage.js | 10 +-- src/Components/TrainingPage.js | 9 +-- src/Components/VideoPage.js | 9 +-- .../__snapshots__/DictionaryPage.test.js.snap | 2 +- .../__snapshots__/DrillListPage.test.js.snap | 73 +++++++++++++++++++ .../DrillPageMinimal.test.js.snap | 18 +++-- .../__snapshots__/FitnessFilters.test.js.snap | 19 +++-- .../__snapshots__/FrisbeeFilters.test.js.snap | 12 +-- .../__snapshots__/ImporterPage.test.js.snap | 4 +- .../__snapshots__/PlayEditorPage.test.js.snap | 24 ++++-- .../__snapshots__/TrainingPage.test.js.snap | 34 +++++---- .../__snapshots__/VideoPage.test.js.snap | 15 ++-- .../RenamePlayModal.test.js.snap | 4 +- .../__snapshots__/SavedPlaysList.test.js.snap | 4 +- src/Components/shared/Button.js | 2 +- .../shared/__snapshots__/Button.test.js.snap | 4 +- .../shared/__snapshots__/Modal.test.js.snap | 2 +- src/styles/filters.style.js | 6 +- 21 files changed, 179 insertions(+), 87 deletions(-) diff --git a/src/Components/DrillPageMinimal.js b/src/Components/DrillPageMinimal.js index eea931a2..1dcf931f 100644 --- a/src/Components/DrillPageMinimal.js +++ b/src/Components/DrillPageMinimal.js @@ -1,6 +1,7 @@ import React, { useLayoutEffect, useCallback } from 'react'; import { Platform, StyleSheet, View, ScrollView, Text } from 'react-native'; import { connect } from 'react-redux'; +import { SafeAreaView } from 'react-native-safe-area-context'; import I18n from '../utils/i18n'; import theme from '../styles/theme.style'; @@ -53,7 +54,7 @@ export const DrillPageMinimal = (props) => { }, [navigation, currentDrillIndex, training]); return ( - <> + {drill.type === DrillTypes.FRISBEE && } @@ -68,7 +69,7 @@ export const DrillPageMinimal = (props) => { )} - + ); }; diff --git a/src/Components/FitnessFilters.js b/src/Components/FitnessFilters.js index 4fc691ef..16a927ec 100644 --- a/src/Components/FitnessFilters.js +++ b/src/Components/FitnessFilters.js @@ -1,6 +1,7 @@ import React from 'react'; import { ScrollView, View, Text } from 'react-native'; import { connect } from 'react-redux'; +import { SafeAreaView } from 'react-native-safe-area-context'; import I18n from '../utils/i18n'; import filterStyle from '../styles/filters.style'; @@ -131,7 +132,7 @@ export class FitnessFilters extends React.Component { } = this.state; return ( - +