assigned with isPreview status

This commit is contained in:
ue 2018-10-22 10:04:40 +03:00
parent 92274d0cf2
commit a3b4d9a2fd
4 changed files with 9 additions and 11 deletions

View File

@ -60,7 +60,7 @@ export default class TagAreaView extends Component {
};
render() {
const { chipsData } = this.props;
const { chipsData, isPreviewActive } = this.props;
const { chips } = this.state;
return (
@ -74,7 +74,7 @@ export default class TagAreaView extends Component {
}}
isPin={i === 0 && chips[1]}
placeholderTextColor="#fff"
editable={!chipsData}
editable={!isPreviewActive}
maxLength={50}
placeholder="tags"
autoFocus={i !== 0 && chips.length - 1 === i}

View File

@ -24,14 +24,14 @@ export default class TitleAreaView extends Component {
// Component Functions
render() {
const { onChange, value } = this.props;
const { onChange, value, isPreviewActive } = this.props;
return (
<View style={globalStyles.containerHorizontal16}>
<TextInput
style={styles.textInput}
placeholderTextColor="c1c5c7"
editable
editable={!isPreviewActive}
maxLength={250}
placeholder="Title"
multiline

View File

@ -13,7 +13,7 @@ class PostFormView extends Component {
};
render() {
const { children, isFormValid } = this.props;
const { children, isFormValid, isPreviewActive } = this.props;
return (
<Fragment>
@ -22,6 +22,7 @@ class PostFormView extends Component {
return React.cloneElement(child, {
onSubmitEditing: item => this._handleOnSubmitEditing(child.props.returnKeyType, item),
returnKeyType: isFormValid ? 'done' : 'next',
isPreviewActive,
});
}
})}

View File

@ -63,12 +63,9 @@ export class EditorScreen extends Component {
isPreviewActive={isPreviewActive}
isFormValid
>
<TitleArea isPreviewActive={isPreviewActive} />
<TagArea isPreviewActive={isPreviewActive} />
<TextArea
handleOnTextChange={this._handleOnTextChange}
isPreviewActive={isPreviewActive}
/>
<TitleArea />
<TagArea />
<TextArea handleOnTextChange={this._handleOnTextChange} />
</PostForm>
</View>
);