fix actionSheet

This commit is contained in:
ammarahm-ed
2021-06-11 10:38:14 +05:00
parent ee3a8a1edc
commit 08f11b9a9b

View File

@@ -1,22 +1,18 @@
import React from 'react'; import React from 'react';
import { View } from 'react-native'; import {View} from 'react-native';
import { Platform } from 'react-native'; import {Platform} from 'react-native';
import ActionSheet from 'react-native-actions-sheet'; import ActionSheet from 'react-native-actions-sheet';
import { useSafeAreaInsets } from 'react-native-safe-area-context'; import {useSafeAreaInsets} from 'react-native-safe-area-context';
import { useTracked } from '../../provider'; import {useTracked} from '../../provider';
import { DDS } from '../../services/DeviceDetection'; import {DDS} from '../../services/DeviceDetection';
import { editing } from '../../utils'; import {editing} from '../../utils';
import { hexToRGBA } from '../../utils/ColorUtils'; import {hexToRGBA} from '../../utils/ColorUtils';
import { sleep } from '../../utils/TimeUtils'; import {sleep} from '../../utils/TimeUtils';
import { import {EditorWebView, textInput} from '../../views/Editor/Functions';
EditorWebView,
textInput
} from '../../views/Editor/Functions';
import tiny from '../../views/Editor/tiny/tiny'; import tiny from '../../views/Editor/tiny/tiny';
import { focusEditor } from '../../views/Editor/tiny/toolbar/constants'; import {focusEditor} from '../../views/Editor/tiny/toolbar/constants';
import { Toast } from '../Toast'; import {Toast} from '../Toast';
import { GetPremium } from './GetPremium'; import {GetPremium} from './GetPremium';
const ActionSheetWrapper = ({ const ActionSheetWrapper = ({
children, children,
@@ -44,7 +40,7 @@ const ActionSheetWrapper = ({
borderBottomLeftRadius: largeTablet ? 10 : 1, borderBottomLeftRadius: largeTablet ? 10 : 1,
marginBottom: largeTablet ? 50 : 0, marginBottom: largeTablet ? 50 : 0,
alignSelf: 'center', alignSelf: 'center',
paddingTop: gestureEnabled ? 10 : 10, paddingTop: 10,
}; };
}, [colors.bg, gestureEnabled]); }, [colors.bg, gestureEnabled]);
@@ -71,8 +67,7 @@ const ActionSheetWrapper = ({
return ( return (
<ActionSheet <ActionSheet
ref={fwdRef} ref={fwdRef}
hideUnderlay={true} drawUnderStatusBar={false}
containerStyle={style} containerStyle={style}
gestureEnabled={gestureEnabled} gestureEnabled={gestureEnabled}
extraScroll={largeTablet ? 50 : 0} extraScroll={largeTablet ? 50 : 0}
@@ -87,17 +82,17 @@ const ActionSheetWrapper = ({
keyboardShouldPersistTaps="always" keyboardShouldPersistTaps="always"
premium={ premium={
<> <>
<Toast context="local" /> <Toast context="local" />
<GetPremium <GetPremium
context="sheet" context="sheet"
close={() => fwdRef?.current?.hide()} close={() => fwdRef?.current?.hide()}
offset={50} offset={50}
/> />
</> </>
} }
onClose={_onClose}> onClose={_onClose}>
{children} {children}
<View style={{height:Platform.OS === "ios" ? insets.bottom/2 : 20}}/> <View style={{height: Platform.OS === 'ios' ? insets.bottom / 2 : 20}} />
</ActionSheet> </ActionSheet>
); );
}; };