Fixed pr comment requirements

This commit is contained in:
Mustafa Buyukcelebi 2019-02-27 23:47:10 +03:00
parent cfad357871
commit dda2c365b5
6 changed files with 61 additions and 63 deletions

View File

@ -93,17 +93,12 @@ class PostsView extends Component {
let newPosts = [];
this.setState({ isLoading: true });
if ((!filter && tag) || filter === 'feed' || filter === 'blog' || getFor === 'blog') {
if (tag || filter === 'feed' || filter === 'blog' || getFor === 'blog') {
options = {
tag,
limit: 3,
};
} else if (filter == 'reblogs') {
options = {
tag,
limit: 3,
};
} else if (tag) {
} else if (filter === 'reblogs') {
options = {
tag,
limit: 3,

View File

@ -2,6 +2,7 @@ import EStyleSheet from 'react-native-extended-stylesheet';
export default EStyleSheet.create({
inputWrapper: {
marginTop: 20,
backgroundColor: '$primaryLightBackground',
flexDirection: 'row',
height: 44,
@ -10,9 +11,6 @@ export default EStyleSheet.create({
justifyContent: 'center',
marginHorizontal: 16,
},
safeArea: {
marginTop: 20,
},
icon: {
alignSelf: 'center',
color: '$iconColor',

View File

@ -11,31 +11,32 @@ import styles from './searchInputStyles';
/* Props
* ------------------------------------------------
* @prop { type } name - Description....
* @prop { func } onChangeText - The function will trigger when input on change
* @prop { func } handleOnModalClose - Handle on click method for close button
* @prop { string } placeholder - Placeholder for input
* @prop { bool } editable - Editable value for input. Default value is true.
*/
const SearchInputView = ({
onChangeText, handleOnModalClose, placeholder, editable = true,
}) => (
<SafeAreaView style={styles.safeArea}>
<View style={styles.inputWrapper}>
<Icon style={styles.icon} iconType="FontAwesome" name="search" size={15} />
<TextInput
style={styles.input}
onChangeText={text => onChangeText(text)}
placeholder={placeholder}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
autoFocus
editable={editable}
/>
<IconButton
iconStyle={styles.closeIcon}
iconType="Ionicons"
style={styles.closeIconButton}
name="ios-close-circle-outline"
onPress={() => handleOnModalClose()}
/>
</View>
<SafeAreaView style={styles.inputWrapper}>
<Icon style={styles.icon} iconType="FontAwesome" name="search" size={15} />
<TextInput
style={styles.input}
onChangeText={text => onChangeText(text)}
placeholder={placeholder}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
autoFocus
editable={editable}
/>
<IconButton
iconStyle={styles.closeIcon}
iconType="Ionicons"
style={styles.closeIconButton}
name="ios-close-circle-outline"
onPress={() => handleOnModalClose()}
/>
</SafeAreaView>
);

View File

@ -53,6 +53,12 @@ export default EStyleSheet.create({
flexDirection: 'row',
alignItems: 'center',
},
searchItemImageWrapper: {
flex: 1,
},
searchItemTextWrapper: {
flex: 7,
},
searchItemImage: {
width: 40,
height: 40,

View File

@ -59,7 +59,7 @@ class SearchModalView extends PureComponent {
renderItem={({ item }) => (
<TouchableHighlight onPress={() => handleOnPressListItem(searchResults.type, item)}>
<View style={styles.searhItems}>
<View style={{ flex: 1 }}>
<View style={styles.searchItemImageWrapper}>
{item.image && (
<FastImage
source={{
@ -69,7 +69,7 @@ class SearchModalView extends PureComponent {
/>
)}
</View>
<View style={{ flex: 7 }}>
<View style={styles.searchItemTextWrapper}>
{item.text && <Text style={styles.searchItemText}>{item.text}</Text>}
</View>
</View>

View File

@ -22,34 +22,33 @@ class SearchResultScreen extends PureComponent {
const { intl, tag, navigationGoBack } = this.props;
return (
<Fragment>
<View style={styles.container}>
<SearchInput
onChangeText={text => console.log('text :', text)}
handleOnModalClose={navigationGoBack}
placeholder={tag}
editable={false}
/>
<ScrollableTabView
style={globalStyles.tabView}
renderTabBar={() => (
<TabBar
style={styles.tabbar}
tabUnderlineDefaultWidth={80}
tabUnderlineScaleX={2}
tabBarPosition="overlayTop"
/>
)}
<View style={styles.container}>
<SearchInput
onChangeText={() => {}}
handleOnModalClose={navigationGoBack}
placeholder={tag}
editable={false}
/>
<ScrollableTabView
style={globalStyles.tabView}
renderTabBar={() => (
<TabBar
style={styles.tabbar}
tabUnderlineDefaultWidth={80}
tabUnderlineScaleX={2}
tabBarPosition="overlayTop"
/>
)}
>
<View
tabLabel={intl.formatMessage({
id: 'search.posts',
})}
style={styles.tabbarItem}
>
<View
tabLabel={intl.formatMessage({
id: 'search.posts',
})}
style={styles.tabbarItem}
>
<Posts pageType="posts" tag={tag} />
</View>
{/* <View
<Posts pageType="posts" tag={tag} />
</View>
{/* <View
tabLabel={intl.formatMessage({
id: 'search.comments',
})}
@ -62,9 +61,8 @@ class SearchResultScreen extends PureComponent {
pageType="posts"
/>
</Fragment> */}
</ScrollableTabView>
</View>
</Fragment>
</ScrollableTabView>
</View>
);
}
}