updated for image and container

This commit is contained in:
u-e 2019-01-15 13:19:41 +03:00
parent 96040775f2
commit 14dd7b7227
3 changed files with 12 additions and 11 deletions

View File

@ -9,14 +9,17 @@ export default EStyleSheet.create({
}, },
textWrapper: { textWrapper: {
flex: 1, flex: 1,
flexDirection: 'column',
fontSize: 12, fontSize: 12,
marginVertical: 16, paddingVertical: 16,
paddingHorizontal: 16, paddingHorizontal: 16,
color: '$primaryBlack', color: '$primaryBlack',
fontFamily: '$editorFont', fontFamily: '$editorFont',
textAlignVertical: 'top', textAlignVertical: 'top',
}, },
previewContainer: {
flex: 1,
marginHorizontal: 16,
},
inlinePadding: { inlinePadding: {
padding: 8, padding: 8,
}, },

View File

@ -1,19 +1,19 @@
import React, { Component } from 'react'; import React, { Component } from 'react';
import { import {
View, KeyboardAvoidingView, ScrollView, FlatList, Text, Platform, View, KeyboardAvoidingView, FlatList, Text, Platform,
} from 'react-native'; } from 'react-native';
import ActionSheet from 'react-native-actionsheet'; import ActionSheet from 'react-native-actionsheet';
// Utils // Utils
import { markDown2Html } from '../../../utils/markdownToHtml'; import { markDown2Html } from '../../../utils/markdownToHtml';
import applyImageLink from './formats/applyWebLinkFormat';
import Formats from './formats/formats';
// Components // Components
import { IconButton } from '../../iconButton'; import { IconButton } from '../../iconButton';
import { PostBody } from '../../postElements';
import { StickyBar } from '../../basicUIElements'; import { StickyBar } from '../../basicUIElements';
import { TextInput } from '../../textInput'; import { TextInput } from '../../textInput';
import applyImageLink from './formats/applyWebLinkFormat';
import Formats from './formats/formats';
import { PostBody } from '../../postElements';
// Styles // Styles
import styles from './markdownEditorStyles'; import styles from './markdownEditorStyles';
@ -98,10 +98,8 @@ export default class MarkdownEditorView extends Component {
const { text } = this.state; const { text } = this.state;
return ( return (
<View style={styles.textWrapper}> <View style={styles.previewContainer}>
<ScrollView removeClippedSubviews> {text ? <PostBody body={markDown2Html(text)} /> : <Text>...</Text>}
{text ? <PostBody body={markDown2Html(text)} /> : <Text>...</Text>}
</ScrollView>
</View> </View>
); );
}; };

View File

@ -152,7 +152,7 @@ const changeMarkdownImage = input => input.replace(markdownImageRegex, (link) =>
return link; return link;
}); });
const centerStyling = input => input.replace(centerRegex, () => '<center style="text-align: align-items: center;">'); const centerStyling = input => input.replace(centerRegex, () => '<center style="text-align: center; align-items: center; justify-content: center;">');
const steemitUrlHandle = input => input.replace(postRegex, (link) => { const steemitUrlHandle = input => input.replace(postRegex, (link) => {
const postMatch = link.match(postRegex); const postMatch = link.match(postRegex);