mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-21 04:11:50 +03:00
cleaned up quickReplyModal with inputSupportModal
This commit is contained in:
parent
02ece3d2de
commit
73d6964933
@ -1,10 +1,7 @@
|
||||
import React, { useImperativeHandle, useRef, useState } from 'react';
|
||||
import { View as AnimatedView } from 'react-native-animatable'
|
||||
import { forwardRef } from 'react';
|
||||
import { Portal } from 'react-native-portalize';
|
||||
import { QuickReplyModalContent } from './quickReplyModalContent';
|
||||
import styles from './quickReplyModalStyles';
|
||||
import { KeyboardAvoidingView, Platform, View } from 'react-native';
|
||||
import { InputSupportModal } from '../organisms';
|
||||
|
||||
export interface QuickReplyModalProps {
|
||||
fetchPost?: any;
|
||||
@ -30,7 +27,12 @@ const QuickReplyModal = ({ fetchPost }: QuickReplyModalProps, ref) => {
|
||||
setVisible(false);
|
||||
}
|
||||
|
||||
const _renderContent = () => (
|
||||
|
||||
return (
|
||||
<InputSupportModal
|
||||
visible={visible && !!selectedPost}
|
||||
onClose={_onClose}
|
||||
>
|
||||
<QuickReplyModalContent
|
||||
fetchPost={fetchPost}
|
||||
selectedPost={selectedPost}
|
||||
@ -38,36 +40,8 @@ const QuickReplyModal = ({ fetchPost }: QuickReplyModalProps, ref) => {
|
||||
onClose={_onClose}
|
||||
handleCloseRef={handleCloseRef}
|
||||
/>
|
||||
)
|
||||
</InputSupportModal>
|
||||
|
||||
return (
|
||||
<Portal>
|
||||
{
|
||||
visible && (
|
||||
<AnimatedView
|
||||
style={styles.container}
|
||||
duration={300}
|
||||
animation='fadeInUp'>
|
||||
{selectedPost && (
|
||||
<>
|
||||
<View style={styles.container} onTouchEnd={_onClose} />
|
||||
{
|
||||
Platform.select({
|
||||
ios: (
|
||||
<KeyboardAvoidingView style={styles.container} behavior="padding">
|
||||
{_renderContent()}
|
||||
</KeyboardAvoidingView>
|
||||
),
|
||||
android: <View style={styles.container}>{_renderContent()}</View>,
|
||||
})
|
||||
}
|
||||
|
||||
</>
|
||||
)}
|
||||
</AnimatedView>
|
||||
)
|
||||
}
|
||||
</Portal>
|
||||
);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user