mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
refactor(web): added types and some small changes (#1722)
This commit is contained in:
parent
c90dcde7cc
commit
bd71e087d4
6 changed files with 20 additions and 49 deletions
|
|
@ -2,31 +2,21 @@
|
|||
/**
|
||||
* This is the circle icon component.
|
||||
*/
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
import type Icon from 'svelte-material-icons/AbTesting.svelte';
|
||||
|
||||
// TODO: why any here?
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export let logo: any;
|
||||
export let logo: typeof Icon;
|
||||
export let backgroundColor = 'transparent';
|
||||
export let hoverColor = '#e2e7e9';
|
||||
export let size = '24';
|
||||
export let title = '';
|
||||
let iconButton: HTMLButtonElement;
|
||||
const dispatch = createEventDispatcher();
|
||||
|
||||
$: {
|
||||
if (iconButton) {
|
||||
iconButton.style.backgroundColor = backgroundColor;
|
||||
iconButton.style.setProperty('--immich-icon-button-hover-color', hoverColor);
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<button
|
||||
{title}
|
||||
bind:this={iconButton}
|
||||
style:backgroundColor
|
||||
style:--immich-icon-button-hover-color={hoverColor}
|
||||
class={`immich-circle-icon-button dark:text-immich-dark-fg hover:dark:text-immich-dark-gray rounded-full p-3 flex place-items-center place-content-center transition-all`}
|
||||
on:click={(mouseEvent) => dispatch('click', { mouseEvent })}
|
||||
on:click
|
||||
>
|
||||
<svelte:component this={logo} {size} />
|
||||
</button>
|
||||
|
|
|
|||
|
|
@ -1,8 +1,8 @@
|
|||
<script lang="ts">
|
||||
import type Icon from 'svelte-material-icons/AbTesting.svelte';
|
||||
|
||||
export let title: string;
|
||||
// TODO: why `any` here? There should be a expected type for this
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
export let logo: any;
|
||||
export let logo: typeof Icon;
|
||||
export let isSelected: boolean;
|
||||
|
||||
import { createEventDispatcher } from 'svelte';
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue