Skip to content

Commit

Permalink
fix: header text changed for search with no query and valid date.
Browse files Browse the repository at this point in the history
  • Loading branch information
syam babu committed Jan 31, 2024
1 parent b95fbfa commit 5010e69
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 5 deletions.
11 changes: 9 additions & 2 deletions src/components/resultHeader/ResultHeader.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,15 +22,22 @@ const ResultHeader = () => {
return (
<>
<div className="result-header">
{isSearchEmpty && (
{isSearchEmpty && isDateRangePresent && (
<p>
{totalCount > 0
? ` ${t('resultHeader.upcoming')} ${totalCount} ${t('events')} "${dateText}`
: `${t('resultHeader.noEvents')}`}
</p>
)}
{isSearchEmpty && !isDateRangePresent && (
<p>
{totalCount > 0
? `${t('resultHeader.upcoming')} ${totalCount} ${t('events')}`
: `${t('resultHeader.noEvents')} `}
</p>
)}

{!isSearchEmpty && (
{!isSearchEmpty && !isDateRangePresent && (
<p>
{totalCount > 0
? ` ${totalCount} ${t(
Expand Down
6 changes: 3 additions & 3 deletions src/components/search/Search.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import WidgetContext from '../../context/WidgetContext';
import './search.css';
import { ReactComponent as SearchIcon } from '../../assets/Search.svg';
import { ReactComponent as ClearIcon } from '../../assets/close-Circle.svg';
import { ReactComponent as FilterIcon } from '../../assets/Custom.svg';
// import { ReactComponent as FilterIcon } from '../../assets/Custom.svg';
import { sessionStorageVariableNames } from '../../constants/sessionStorageVariableNames';

const Search = () => {
Expand All @@ -32,12 +32,12 @@ const Search = () => {
sessionStorage.setItem(sessionStorageVariableNames.WidgetSearchKeyWord, e.target.value);
}}
/>
<div
{/* <div
className="filter-icon-container"
style={searchKeyWord ? { right: '40px' } : { right: '10px' }}
>
<FilterIcon className="filter-icon" />
</div>
</div> */}
{searchKeyWord && (
<div className="clear-icon-container" onClick={clearSearch}>
<ClearIcon className="clear-icon" />
Expand Down

0 comments on commit 5010e69

Please sign in to comment.