-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5d4dce5
commit cf37250
Showing
3 changed files
with
12 additions
and
63 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
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
59 changes: 10 additions & 49 deletions
59
web/src/lib/components/shared-components/search-bar/search-text-section.svelte
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 |
---|---|---|
@@ -1,57 +1,18 @@ | ||
<script lang="ts"> | ||
export let fileName: string | undefined; | ||
export let context: string | undefined; | ||
enum TextSearchOptions { | ||
Context = 'context', | ||
FileName = 'file-name', | ||
} | ||
let selectedOption = context ? TextSearchOptions.Context : TextSearchOptions.FileName; | ||
$: { | ||
if (selectedOption === TextSearchOptions.Context) { | ||
fileName = undefined; | ||
} else { | ||
context = undefined; | ||
} | ||
} | ||
</script> | ||
|
||
<div class="flex gap-5"> | ||
<label class="immich-form-label" for="context"> | ||
<input type="radio" name="context" id="context" bind:group={selectedOption} value={TextSearchOptions.Context} /> | ||
<span>CONTEXT</span> | ||
</label> | ||
|
||
<label class="immich-form-label" for="file-name"> | ||
<input | ||
type="radio" | ||
name="file-name" | ||
id="file-name" | ||
bind:group={selectedOption} | ||
value={TextSearchOptions.FileName} | ||
/> | ||
<span>FILE NAME</span> | ||
<label class="immich-form-label" for="text"> | ||
<span>TEXT</span> | ||
</label> | ||
</div> | ||
|
||
{#if selectedOption === TextSearchOptions.Context} | ||
<input | ||
class="immich-form-input hover:cursor-text w-full !mt-1" | ||
type="text" | ||
id="context" | ||
name="context" | ||
placeholder="Sunrise on the beach" | ||
bind:value={context} | ||
/> | ||
{:else} | ||
<input | ||
class="immich-form-input hover:cursor-text w-full !mt-1" | ||
type="text" | ||
id="file-name" | ||
name="file-name" | ||
placeholder="IMG_1234.jpg" | ||
bind:value={fileName} | ||
/> | ||
{/if} | ||
<input | ||
class="immich-form-input hover:cursor-text w-full !mt-1" | ||
type="text" | ||
id="text" | ||
name="text" | ||
placeholder={'Photo\'s context such as "Baby with yellow teddy bear", or file name, or file extension'} | ||
bind:value={context} | ||
/> |