This repository has been archived by the owner on May 28, 2024. It is now read-only.
forked from zackkrida/things-app
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #50 from pvdthings/SearchIcons
Add icon for search and clear search
- Loading branch information
Showing
4 changed files
with
29 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
<script> | ||
import { TextInput } from '$lib/components'; | ||
import { t } from '$lib/language/translate'; | ||
import { searchFilter } from '$lib/stores/catalog'; | ||
import XMarkIcon from '$lib/icons/x-mark.svg'; | ||
import SearchIcon from '$lib/icons/magnifying-glass.svg'; | ||
const clearSearch = () => { | ||
$searchFilter = ''; | ||
}; | ||
</script> | ||
|
||
<div class="relative"> | ||
<img src={SearchIcon} alt="searchIcon" class="w-6 h-6 absolute top-2.5 left-2 transform" /> | ||
<TextInput bind:value={$searchFilter} placeholder={$t('Input.Search')} /> | ||
{#if $searchFilter.length > 0} | ||
<button class="btn btn-circle btn-sm btn-ghost absolute right-2 top-1.5" on:click={clearSearch}> | ||
<img src={XMarkIcon} alt="searchIcon" class="w-5 h-5 absolute top-1.75 left-2.25 transform" /> | ||
</button> | ||
{/if} | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters