diff --git a/app/actions/actionsTypes.ts b/app/actions/actionsTypes.ts index a920e27e..29c38478 100644 --- a/app/actions/actionsTypes.ts +++ b/app/actions/actionsTypes.ts @@ -54,6 +54,7 @@ export const SERVER = createRequestTypes('SERVER', [ ]); export const METEOR = createRequestTypes('METEOR_CONNECT', [...defaultTypes, 'DISCONNECT']); export const LOGOUT = 'LOGOUT'; // logout is always success +export const DELETE_ACCOUNT = 'DELETE_ACCOUNT'; export const SNIPPETED_MESSAGES = createRequestTypes('SNIPPETED_MESSAGES', ['OPEN', 'READY', 'CLOSE', 'MESSAGES_RECEIVED']); export const DEEP_LINKING = createRequestTypes('DEEP_LINKING', ['OPEN']); export const SORT_PREFERENCES = createRequestTypes('SORT_PREFERENCES', ['SET_ALL', 'SET']); diff --git a/app/actions/login.ts b/app/actions/login.ts index 990c9f85..17174145 100644 --- a/app/actions/login.ts +++ b/app/actions/login.ts @@ -121,3 +121,9 @@ export function setLocalAuthenticated(isLocalAuthenticated: boolean): ISetLocalA isLocalAuthenticated }; } + +export function deleteAccount(): Action { + return { + type: types.DELETE_ACCOUNT + }; +} diff --git a/app/containers/ActionSheet/ActionSheet.tsx b/app/containers/ActionSheet/ActionSheet.tsx index c5cd66de..83c2e8ff 100644 --- a/app/containers/ActionSheet/ActionSheet.tsx +++ b/app/containers/ActionSheet/ActionSheet.tsx @@ -116,6 +116,10 @@ const ActionSheet = React.memo( const bottomSheet = isLandscape || isTablet ? styles.bottomSheet : {}; + // Must need this prop to avoid keyboard dismiss + // when is android tablet and the input text is focused + const androidTablet: any = isTablet && isLandscape && !isIOS ? { android_keyboardInputMode: 'adjustResize' } : {}; + return ( <> {children} @@ -130,7 +134,8 @@ const ActionSheet = React.memo( enablePanDownToClose style={{ ...styles.container, ...bottomSheet }} backgroundStyle={{ backgroundColor: colors.focusedBackground }} - onChange={index => index === -1 && toggleVisible()}> + onChange={index => index === -1 && toggleVisible()} + {...androidTablet}> )} diff --git a/app/containers/ActionSheet/FooterButtons.tsx b/app/containers/ActionSheet/FooterButtons.tsx new file mode 100644 index 00000000..ecdf0455 --- /dev/null +++ b/app/containers/ActionSheet/FooterButtons.tsx @@ -0,0 +1,36 @@ +import React from 'react'; +import { View } from 'react-native'; + +import Button from '../Button'; +import { useTheme } from '../../theme'; +import styles from './styles'; + +const FooterButtons = ({ + cancelAction = () => {}, + confirmAction = () => {}, + cancelTitle = '', + confirmTitle = '', + disabled = false, + cancelBackgroundColor = '', + confirmBackgroundColor = '' +}): React.ReactElement => { + const { colors } = useTheme(); + return ( + +