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 } });
}
};
const _renderEditor = () => (
<>
{isReply && !isEdit && <SummaryArea summary={post.summary} />}
@ -471,7 +470,7 @@ const MarkdownEditorView = ({
<TextInput
multiline
autoCorrect={true}
autoFocus={isReply && draftBtnTooltipRegistered ? true : false}
autoFocus={true}
onChangeText={_changeText}
onSelectionChange={_handleOnSelectionChange}
placeholder={intl.formatMessage({

View File

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

View File

@ -16,7 +16,6 @@ import { default as ROUTES } from '../../constants/routeNames';
import get from 'lodash/get';
import { navigate } from '../../navigation/service';
import { Portal } from 'react-native-portalize';
import { renderPostBody } from '@ecency/render-helper';
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
const _renderSheetHeader = () => (
@ -202,6 +214,37 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
</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 = () => {
return (
<View style={styles.modalContainer}>
@ -225,21 +268,8 @@ const QuickReplyModal = ({}: QuickReplyModalProps, ref) => {
/>
</View>
<View style={styles.footer}>
<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}
/>
{_renderExpandBtn()}
{_renderReplyBtn()}
</View>
</View>
);