Skip to content

Commit c7143bb

Browse files
author
Kashish Grover
committed
Fix for android
1 parent e456c7e commit c7143bb

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

src/screens/FeedScreen.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ import {
99
import PostCard from '../components/PostCard';
1010
import color from '../theme/color';
1111
import config from '../config';
12-
import shuffle from '../utils/shuffle';
12+
// import shuffle from '../utils/shuffle';
1313

1414
const GET_DATA_URL = `${config.baseUrl}/posts`;
1515

@@ -46,7 +46,7 @@ class FeedScreen extends React.Component {
4646
<View style={styles.container}>
4747
<View style={styles.headerContainer}>
4848
<Text style={styles.headerText}>
49-
{'🤷🏻‍♂️ Ipsum'}
49+
{'Ipsum Diary'}
5050
</Text>
5151
</View>
5252
{

src/screens/NewPostScreen.js

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
22
import {
3-
View,
3+
ScrollView,
44
StyleSheet,
55
KeyboardAvoidingView,
66
Platform,
@@ -27,6 +27,7 @@ const DescriptionInput = styled.TextInput`
2727
borderRadius: 4px;
2828
fontSize: 14;
2929
height: 200px;
30+
textAlignVertical: top;
3031
`;
3132

3233
const SubmitButton = styled.TouchableOpacity`
@@ -52,7 +53,7 @@ class NewPostScreen extends React.Component {
5253

5354
checkIfEditPost = () => {
5455
const { navigation: { state: { params } } } = this.props;
55-
this.setState({ isEditPost: !!params.id });
56+
this.setState({ isEditPost: !!params });
5657
}
5758

5859
handleSubmitPost = async () => {
@@ -107,11 +108,14 @@ class NewPostScreen extends React.Component {
107108
return (
108109
<KeyboardAvoidingView
109110
style={styles.container}
110-
behavior="padding"
111+
behavior={isPlatformIOS ? 'padding' : null}
111112
keyboardVerticalOffset={isPlatformIOS ? 18 : 0}
112113
>
113114
<Header />
114-
<View style={styles.content}>
115+
<ScrollView
116+
style={styles.content}
117+
keyboardShouldPersistTaps="handled"
118+
>
115119
<TitleInput
116120
innerRef={(x) => { this.titleRef = x; }}
117121
placeholder="Your awesome title..."
@@ -128,7 +132,7 @@ class NewPostScreen extends React.Component {
128132
multiline
129133
defaultValue={isEditPost ? params.description : ''}
130134
/>
131-
</View>
135+
</ScrollView>
132136
<SubmitButton
133137
onPress={isEditPost ? this.handleEditPost : this.handleSubmitPost}
134138
>

0 commit comments

Comments
 (0)