搜索相关

This commit is contained in:
tangly1024
2022-03-01 11:19:33 +08:00
parent 9e3bcb75e5
commit 1bdd079b64
2 changed files with 2 additions and 2 deletions

View File

@@ -12,7 +12,7 @@ export const LayoutSearch = (props) => {
<StickyBar>
<div className="p-4 dark:text-gray-200">
<i className="mr-1 fas fa-search" />{' '}
{posts.length} {locale.COMMON.RESULT_OF_SEARCH}
{posts?.length} {locale.COMMON.RESULT_OF_SEARCH}
</div>
</StickyBar>
<div className="md:mt-5">

View File

@@ -52,7 +52,7 @@ const SearchInput = ({ currentTag, currentSearch, cRef }) => {
onChange={e => updateSearchKey(e.target.value)}
defaultValue={searchKey}
/>
{(searchKey && searchKey.length && <i className='fas fa-times text-gray-300 float-right m-3 cursor-pointer absolute' onClick={cleanSearch} />)}
{(searchKey && searchKey.length && <i className='fas fa-times text-gray-300 float-right m-3 cursor-pointer' onClick={cleanSearch} />)}
<div className='p-3 bg-gray-50 flex border-l dark:border-gray-700 dark:hover:bg-gray-800 dark:bg-gray-600 justify-center items-center cursor-pointer'
onClick={() => { handleSearch(searchKey) }}>