Skip to content

Commit

Permalink
Improve layout and fix toggle
Browse files Browse the repository at this point in the history
  • Loading branch information
Lukasdotcom committed Dec 21, 2024
1 parent 6affe87 commit ccdde67
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
13 changes: 10 additions & 3 deletions web/src/lib/components/faces-page/assign-face-side-panel.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,17 @@
<CircleIconButton icon={mdiClose} title={$t('cancel_search')} onclick={() => (searchFaces = false)} />
{/if}
</div>
<div class="flex w-full justify-center">
<SettingSwitch bind:checked={sortFaces} onToggle={loadPeople} title={$t('sort_people_by_similarity')} />
</div>
<div class="px-4 py-4 text-sm">
<div class="flex w-full justify-center">
<SettingSwitch
bind:checked={sortFaces}
onToggle={async (checked) => {
sortFaces = checked;
await loadPeople();
}}
title={$t('sort_people_by_similarity')}
/>
</div>
<h2 class="mb-8 mt-4 uppercase">{$t('all_people')}</h2>
{#if isShowLoadingPeople}
<div class="flex w-full justify-center">
Expand Down
22 changes: 14 additions & 8 deletions web/src/lib/components/faces-page/people-list.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@
import SettingSwitch from '$lib/components/shared-components/settings/setting-switch.svelte';
interface Props {
sortFaces: boolean;
sortFaces?: boolean;
screenHeight: number;
people: PersonResponseDto[];
peopleToNotShow: PersonResponseDto[];
onSelect: (person: PersonResponseDto) => void;
handleSearch: () => void;
handleSearch?: () => void;
}
let { sortFaces = $bindable(true), screenHeight, people, peopleToNotShow, onSelect, handleSearch }: Props = $props();
Expand All @@ -30,12 +30,18 @@
<div class=" w-40 sm:w-48 md:w-96 h-14 mb-8">
<SearchPeople type="searchBar" placeholder={$t('search_people')} bind:searchName={name} bind:searchedPeopleLocal />
</div>

<div class=" w-40 sm:w-48 md:w-96 mb-8">
<SettingSwitch onToggle={handleSearch} bind:checked={sortFaces} title={$t('sort_people_by_similarity')}
></SettingSwitch>
</div>

{#if handleSearch}
<div class=" w-40 sm:w-48 md:w-96 mb-8">
<SettingSwitch
onToggle={(checked) => {
sortFaces = checked;
handleSearch();
}}
bind:checked={sortFaces}
title={$t('sort_people_by_similarity')}
></SettingSwitch>
</div>
{/if}
<div
class="immich-scrollbar overflow-y-auto rounded-3xl bg-gray-200 p-10 dark:bg-immich-dark-gray"
style:max-height={screenHeight - 400 + 'px'}
Expand Down

0 comments on commit ccdde67

Please sign in to comment.