From 2b1f78f3ecb1d04879051d2a29c1bedfbd5d537a Mon Sep 17 00:00:00 2001 From: Gerzon Z Date: Fri, 3 Sep 2021 11:11:57 -0400 Subject: [PATCH] Fix search --- app/views/DiscussionMessagesView.js | 5 ++--- app/views/ThreadMessagesView/SearchHeader.js | 11 ++++++----- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/views/DiscussionMessagesView.js b/app/views/DiscussionMessagesView.js index 3f908177d..595d8f18d 100644 --- a/app/views/DiscussionMessagesView.js +++ b/app/views/DiscussionMessagesView.js @@ -72,8 +72,7 @@ const DiscussionMessagesView = ({ navigation, route }) => { ]; if (text?.trim()) { - whereClause.push(Q.where('msg', Q.like(`%${ sanitizeLikeString(text?.trim()) }%`)), - Q.where('username', Q.like(`%${ sanitizeLikeString(text?.trim()) }%`))); + whereClause.push(Q.where('msg', Q.like(`%${ sanitizeLikeString(text?.trim()) }%`))); } const discussionsMessages = await db @@ -107,7 +106,7 @@ const DiscussionMessagesView = ({ navigation, route }) => { /> ), - headerTitle: () => , + headerTitle: () => , headerTitleContainerStyle: { left: headerTitlePosition.left, right: headerTitlePosition.right diff --git a/app/views/ThreadMessagesView/SearchHeader.js b/app/views/ThreadMessagesView/SearchHeader.js index ae8c96e84..8bb82f26e 100644 --- a/app/views/ThreadMessagesView/SearchHeader.js +++ b/app/views/ThreadMessagesView/SearchHeader.js @@ -2,7 +2,7 @@ import React from 'react'; import { StyleSheet, View } from 'react-native'; import PropTypes from 'prop-types'; -import { withTheme } from '../../theme'; +import { useTheme, withTheme } from '../../theme'; import sharedStyles from '../Styles'; import { themes } from '../../constants/colors'; import TextInput from '../../presentation/TextInput'; @@ -21,7 +21,8 @@ const styles = StyleSheet.create({ }); // TODO: it might be useful to refactor this component for reusage -const SearchHeader = ({ theme, onSearchChangeText }) => { +const SearchHeader = ({ onSearchChangeText, placeholder }) => { + const { theme } = useTheme(); const titleColorStyle = { color: themes[theme].headerTitleColor }; const isLight = theme === 'light'; const { isLandscape } = useOrientation(); @@ -33,7 +34,7 @@ const SearchHeader = ({ theme, onSearchChangeText }) => { { }; SearchHeader.propTypes = { - theme: PropTypes.string, - onSearchChangeText: PropTypes.func + onSearchChangeText: PropTypes.func, + placeholder: PropTypes.string }; export default withTheme(SearchHeader);