TSK-1060. Fixed presenters and control panels (aside) (#2901)

Signed-off-by: Alexander Platov <sas_lord@mail.ru>
This commit is contained in:
Alexander Platov
2023-04-06 11:51:13 +07:00
committed by GitHub
parent a496d7ec1c
commit 1388a8933e
20 changed files with 88 additions and 54 deletions
@@ -59,7 +59,9 @@
<Button {kind} {size} {width} {justify} on:click={handleClick}>
<svelte:fragment slot="content">
{#if state}
<div class="pointer-events-none"><StatePresenter value={state} /></div>
<div class="pointer-events-none clear-mins">
<StatePresenter value={state} />
</div>
{/if}
</svelte:fragment>
</Button>
@@ -18,24 +18,34 @@
import { getColorNumberByText, getPlatformColor } from '@hcengineering/ui'
export let value: State | undefined
export let shouldShowAvatar = true
export let inline: boolean = false
</script>
{#if value}
<div class="flex-row-center">
<div
class="state-container"
style="background-color: {getPlatformColor(value.color ?? getColorNumberByText(value.name))}"
/>
<span class="overflow-label">{value.name}</span>
<div class="flex-presenter" class:inline-presenter={inline}>
{#if shouldShowAvatar}
<div
class="state-container"
class:inline
style="background-color: {getPlatformColor(value.color ?? getColorNumberByText(value.name))}"
/>
{/if}
<span class="label nowrap">{value.name}</span>
</div>
{/if}
<style lang="scss">
.state-container {
flex-shrink: 0;
margin-right: 0.5rem;
width: 0.875rem;
height: 0.875rem;
border: 1px solid rgba(0, 0, 0, 0.1);
border-radius: 0.25rem;
&.inline {
transform: translateY(0.125rem);
}
}
</style>