Skip to content

Commit

Permalink
custom workarounds removed
Browse files Browse the repository at this point in the history
  • Loading branch information
kanzitelli committed Dec 20, 2020
1 parent d52582f commit 815c4a8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 20 deletions.
3 changes: 0 additions & 3 deletions src/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,9 +77,6 @@ export const startApp = async () => {
children: [{
component: {
name: Constants.ScreenNames.ExpoScreen,
passProps: {
hackForTabScreenLargeTitleIOS14: true,
}
},
}],
options: {
Expand Down
2 changes: 1 addition & 1 deletion src/screens/CounterScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ const CounterScreen: NavigationFunctionComponent = observer(({
componentId,
}) => {
const { counter } = useStores();
const { appUpdates } = useServices();
const { } = useServices();
const { styles } = useStyles(_styles);

useNavigationButtonPress(counter.decrement, componentId, Constants.CounterScreen.decButtonId);
Expand Down
20 changes: 4 additions & 16 deletions src/screens/ExpoScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,29 +22,17 @@ import { ButtonTitle } from '../components/Button';
import useStyles from '../utils/useStyles';
import NView from '../components/NView';

type ExpoScreenProps = {
hackForTabScreenLargeTitleIOS14: boolean; // large title collapsed if a screen is on one of the tab but first
}
type ExpoScreenProps = { }

const ExpoScreen: NavigationFunctionComponent<ExpoScreenProps> = observer(({
componentId,
hackForTabScreenLargeTitleIOS14 = false,
}) => {
const { ui } = useStores();
const { navigation, t } = useServices();
const { styles } = useStyles(_styles);

const [safeArea, setSafeArea] = useState(false); // hack for Large Title + ScrollView
const [contentHidden, setContentHidden] = useState(hackForTabScreenLargeTitleIOS14); // hack for Large Title iOS14 on 2+ tab view

useEffect(() => {
setTimeout(() => setSafeArea(true), 250);
}, [componentId]);

useNavigationComponentDidAppear(() => {
getNetworkType();

setContentHidden(false);
}, componentId);

const getNetworkType = async () => {
Expand All @@ -55,8 +43,8 @@ const ExpoScreen: NavigationFunctionComponent<ExpoScreenProps> = observer(({
} catch (e) { }
}

return contentHidden ? <NView safe={true} /> : (
<NView safe={safeArea}>
return (
<>
<ScrollView>
<View style={styles.section}>
<Text style={styles.header}>
Expand Down Expand Up @@ -94,7 +82,7 @@ const ExpoScreen: NavigationFunctionComponent<ExpoScreenProps> = observer(({
/>
</View>
</ScrollView>
</NView>
</>
)
});

Expand Down

0 comments on commit 815c4a8

Please sign in to comment.