chore(web): migrate CircleIconButton to @immich/ui IconButton (#18486)
* remove import and referenced file * first pass at replacing all CircleIconButtons * fix linting issues * fix combobox formatting issues * fix button context menu coloring * remove circle icon button from search history box * use theme switcher from UI lib * dark mode force the asset viewer icons * fix forced dark mode icons * dark mode memory viewer icons * fix: back button in memory viewer --------- Co-authored-by: Alex <alex.tran1502@gmail.com>
This commit is contained in:
@@ -2,44 +2,23 @@
|
||||
import { t } from 'svelte-i18n';
|
||||
import { onMount } from 'svelte';
|
||||
import { mdiCast, mdiCastConnected } from '@mdi/js';
|
||||
import CircleIconButton from '$lib/components/elements/buttons/circle-icon-button.svelte';
|
||||
import { CastDestinationType, castManager } from '$lib/managers/cast-manager.svelte';
|
||||
import { GCastDestination } from '$lib/utils/cast/gcast-destination.svelte';
|
||||
import { IconButton } from '@immich/ui';
|
||||
|
||||
interface Props {
|
||||
whiteHover?: boolean;
|
||||
navBar?: boolean;
|
||||
}
|
||||
|
||||
let { whiteHover, navBar }: Props = $props();
|
||||
|
||||
onMount(async () => {
|
||||
await castManager.initialize();
|
||||
});
|
||||
|
||||
const getButtonColor = () => {
|
||||
return castManager.isCasting ? 'primary' : whiteHover ? undefined : 'opaque';
|
||||
};
|
||||
</script>
|
||||
|
||||
{#if castManager.availableDestinations.length > 0 && castManager.availableDestinations[0].type === CastDestinationType.GCAST}
|
||||
{#if navBar}
|
||||
<IconButton
|
||||
shape="round"
|
||||
variant="ghost"
|
||||
size="medium"
|
||||
color={castManager.isCasting ? 'primary' : 'secondary'}
|
||||
icon={castManager.isCasting ? mdiCastConnected : mdiCast}
|
||||
onclick={() => void GCastDestination.showCastDialog()}
|
||||
aria-label={$t('cast')}
|
||||
/>
|
||||
{:else}
|
||||
<CircleIconButton
|
||||
color={getButtonColor()}
|
||||
icon={castManager.isCasting ? mdiCastConnected : mdiCast}
|
||||
onclick={GCastDestination.showCastDialog}
|
||||
title={$t('cast')}
|
||||
/>
|
||||
{/if}
|
||||
<IconButton
|
||||
shape="round"
|
||||
variant="ghost"
|
||||
size="medium"
|
||||
color={castManager.isCasting ? 'primary' : 'secondary'}
|
||||
icon={castManager.isCasting ? mdiCastConnected : mdiCast}
|
||||
onclick={() => void GCastDestination.showCastDialog()}
|
||||
aria-label={$t('cast')}
|
||||
/>
|
||||
{/if}
|
||||
|
||||
Reference in New Issue
Block a user