2022-06-03 11:04:30 -05:00
|
|
|
<script lang="ts">
|
2022-07-23 13:08:49 -05:00
|
|
|
/**
|
|
|
|
|
* This is the circle icon component.
|
|
|
|
|
*/
|
2022-06-03 11:04:30 -05:00
|
|
|
import { createEventDispatcher } from 'svelte';
|
|
|
|
|
|
|
|
|
|
export let logo: any;
|
2022-07-23 13:08:49 -05:00
|
|
|
export let backgroundColor: string = 'transparent';
|
|
|
|
|
export let hoverColor: string = '#e2e7e9';
|
|
|
|
|
export let logoColor: string = '#5f6368';
|
|
|
|
|
export let size = '24';
|
|
|
|
|
export let title = '';
|
|
|
|
|
let iconButton: HTMLButtonElement;
|
2022-06-03 11:04:30 -05:00
|
|
|
const dispatch = createEventDispatcher();
|
2022-07-23 13:08:49 -05:00
|
|
|
|
|
|
|
|
$: {
|
|
|
|
|
if (iconButton) {
|
|
|
|
|
iconButton.style.backgroundColor = backgroundColor;
|
|
|
|
|
iconButton.style.setProperty('--immich-icon-button-hover-color', hoverColor);
|
|
|
|
|
}
|
|
|
|
|
}
|
2022-06-03 11:04:30 -05:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<button
|
2022-07-23 13:08:49 -05:00
|
|
|
{title}
|
|
|
|
|
bind:this={iconButton}
|
|
|
|
|
class={`immich-circle-icon-button rounded-full p-3 flex place-items-center place-content-center transition-all`}
|
2022-06-03 11:04:30 -05:00
|
|
|
on:click={() => dispatch('click')}
|
|
|
|
|
>
|
2022-07-23 13:08:49 -05:00
|
|
|
<svelte:component this={logo} {size} color={logoColor} />
|
2022-06-03 11:04:30 -05:00
|
|
|
</button>
|
2022-07-23 13:08:49 -05:00
|
|
|
|
|
|
|
|
<style>
|
|
|
|
|
:root {
|
|
|
|
|
--immich-icon-button-hover-color: #d3d3d3;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
.immich-circle-icon-button:hover {
|
|
|
|
|
background-color: var(--immich-icon-button-hover-color) !important;
|
|
|
|
|
}
|
|
|
|
|
</style>
|