mirror of
https://github.com/ecency/ecency-mobile.git
synced 2024-12-30 09:07:28 +03:00
Added click method for tag component
This commit is contained in:
parent
cfad357871
commit
dc410b7567
@ -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';
|
||||
|
55
src/components/basicUIElements/view/tag/tagContainer.js
Normal file
55
src/components/basicUIElements/view/tag/tagContainer.js
Normal 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);
|
@ -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
|
||||
|
@ -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}
|
||||
|
Loading…
Reference in New Issue
Block a user