added expand comment in quick reply modal

This commit is contained in:
Sadaqat Ali 2022-04-16 10:39:46 +05:00
parent 5200264343
commit a2cf7968ca
3 changed files with 53 additions and 20 deletions

View File

@ -423,7 +423,6 @@ const MarkdownEditorView = ({
_setTextAndSelection({ text: '', selection: { start: 0, end: 0 } }); _setTextAndSelection({ text: '', selection: { start: 0, end: 0 } });
} }
}; };
const _renderEditor = () => ( const _renderEditor = () => (
<> <>
{isReply && !isEdit && <SummaryArea summary={post.summary} />} {isReply && !isEdit && <SummaryArea summary={post.summary} />}
@ -471,7 +470,7 @@ const MarkdownEditorView = ({
<TextInput <TextInput
multiline multiline
autoCorrect={true} autoCorrect={true}
autoFocus={isReply && draftBtnTooltipRegistered ? true : false} autoFocus={true}
onChangeText={_changeText} onChangeText={_changeText}
onSelectionChange={_handleOnSelectionChange} onSelectionChange={_handleOnSelectionChange}
placeholder={intl.formatMessage({ placeholder={intl.formatMessage({

View File

@ -46,7 +46,7 @@ export default EStyleSheet.create({
}, },
footer: { footer: {
flexDirection: 'row', flexDirection: 'row',
justifyContent: 'flex-end', justifyContent: 'space-between',
alignItems: 'center', alignItems: 'center',
paddingHorizontal:16, paddingHorizontal:16,
}, },
@ -56,11 +56,15 @@ export default EStyleSheet.create({
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
}, },
replyBtnContainer: {
flexDirection: 'row',
alignItems: 'center',
},
replySection: { replySection: {
paddingTop: 10, paddingTop: 10,
paddingBottom: 0, paddingBottom: 0,
}, },
accountTile: { accountTile: {
height: 60, height: 60,
flexDirection: 'row', flexDirection: 'row',

View File

@ -16,7 +16,6 @@ import { default as ROUTES } from '../../constants/routeNames';
import get from 'lodash/get'; import get from 'lodash/get';
import { navigate } from '../../navigation/service'; import { navigate } from '../../navigation/service';
import { Portal } from 'react-native-portalize'; import { Portal } from 'react-native-portalize';
import { renderPostBody } from '@ecency/render-helper';
export interface QuickReplyModalProps {} export interface QuickReplyModalProps {}
@ -172,6 +171,19 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
} }
}; };
const _handleExpandBtn = () => {
if(selectedPost){
navigate({
routeName: ROUTES.SCREENS.EDITOR,
key: 'editor_replay',
params: {
isReply: true,
post: selectedPost,
},
});
sheetModalRef.current?.setModalVisible(false);
}
}
//VIEW_RENDERERS //VIEW_RENDERERS
const _renderSheetHeader = () => ( const _renderSheetHeader = () => (
@ -202,6 +214,37 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
</View> </View>
); );
const _renderExpandBtn = () => (
<View style={styles.expandBtnContainer}>
<IconButton
iconStyle={styles.backIcon}
iconType="MaterialCommunityIcons"
name="arrow-expand"
onPress={_handleExpandBtn}
size={28}
color={EStyleSheet.value('$primaryBlack')}
/>
</View>
)
const _renderReplyBtn = () => (
<View style={styles.replyBtnContainer}>
<TextButton
style={styles.cancelButton}
onPress={_handleClosePress}
text={intl.formatMessage({
id: 'quick_reply.close',
})}
/>
<MainButton
style={styles.commentBtn}
onPress={() => _submitReply()}
text={intl.formatMessage({
id: 'quick_reply.reply',
})}
isLoading={isSending}
/>
</View>
);
const _renderContent = () => { const _renderContent = () => {
return ( return (
<View style={styles.modalContainer}> <View style={styles.modalContainer}>
@ -225,21 +268,8 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
/> />
</View> </View>
<View style={styles.footer}> <View style={styles.footer}>
<TextButton {_renderExpandBtn()}
style={styles.cancelButton} {_renderReplyBtn()}
onPress={_handleClosePress}
text={intl.formatMessage({
id: 'quick_reply.close',
})}
/>
<MainButton
style={styles.commentBtn}
onPress={() => _submitReply()}
text={intl.formatMessage({
id: 'quick_reply.reply',
})}
isLoading={isSending}
/>
</View> </View>
</View> </View>
); );