Added click method for tag component

This commit is contained in:
Mustafa Buyukcelebi 2019-02-26 14:51:47 +03:00
parent cfad357871
commit dc410b7567
4 changed files with 60 additions and 4 deletions

View File

@ -8,7 +8,7 @@ import PostCardPlaceHolder from './view/placeHolder/postCardPlaceHolderView';
import PostPlaceHolder from './view/placeHolder/postPlaceHolderView';
import ProfileSummaryPlaceHolder from './view/placeHolder/profileSummaryPlaceHolder';
import StickyBar from './view/stickyBar/stickyBarView';
import Tag from './view/tag/tagView';
import Tag from './view/tag/tagContainer';
import TextWithIcon from './view/textWithIcon/textWithIconView';
import UserListItem from './view/userListItem/userListItem';
import WalletDetailsPlaceHolder from './view/placeHolder/walletDetailsPlaceHolder';

View File

@ -0,0 +1,55 @@
import React, { PureComponent } from 'react';
import { withNavigation } from 'react-navigation';
// Services and Actions
// Middleware
// Constants
import ROUTES from '../../../../constants/routeNames';
// Utilities
// Component
import TagView from './tagView';
/*
* Props Name Description Value
*@props --> props name here description here Value Type Here
*
*/
class TagContainer extends PureComponent {
// Component Life Cycle Functions
// Component Functions
_handleOnTagPress = () => {
const { navigation, onPress, value } = this.props;
if (onPress) {
onPress();
} else {
navigation.navigate({
routeName: ROUTES.SCREENS.SEARCH_RESULT,
params: {
tag: value,
},
});
}
};
render() {
const { isPin, value, isPostCardTag } = this.props;
return (
<TagView
isPin={isPin}
value={value}
isPostCardTag={isPostCardTag}
onPress={this._handleOnTagPress}
/>
);
}
}
export default withNavigation(TagContainer);

View File

@ -14,7 +14,7 @@ import styles from './searchInputStyles';
* @prop { type } name - Description....
*/
const SearchInputView = ({
onChangeText, handleOnModalClose, placeholder, editable = true,
onChangeText, handleOnModalClose, placeholder, editable = true, autoFocus = true,
}) => (
<SafeAreaView style={styles.safeArea}>
<View style={styles.inputWrapper}>
@ -25,7 +25,7 @@ const SearchInputView = ({
placeholder={placeholder}
placeholderTextColor="#c1c5c7"
autoCapitalize="none"
autoFocus
autoFocus={autoFocus}
editable={editable}
/>
<IconButton

View File

@ -27,8 +27,9 @@ class SearchResultScreen extends PureComponent {
<SearchInput
onChangeText={text => console.log('text :', text)}
handleOnModalClose={navigationGoBack}
placeholder={tag}
placeholder={`#${tag}`}
editable={false}
autoFocus={false}
/>
<ScrollableTabView
style={globalStyles.tabView}