Informative icons for the LOVE sidebar (#7275)

Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
This commit is contained in:
Alexander Platov 2024-12-06 13:23:31 +03:00 committed by GitHub
parent d9aa05122e
commit 596185bd5c
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 2 deletions

View File

@ -16,17 +16,30 @@
import type { Asset, IntlString } from '@hcengineering/platform'
import type { AnySvelteComponent } from '@hcengineering/ui'
import { AppItem } from '@hcengineering/workbench-resources'
import { RoomType } from '@hcengineering/love'
import { currentRoom } from '../../stores'
import { isConnected, isSharingEnabled, isCameraEnabled, isMicEnabled } from '../../utils'
import love from '../../plugin'
export let label: IntlString
export let icon: Asset | AnySvelteComponent
export let selected: boolean = false
export let size: 'small' | 'medium' | 'large' = 'small'
$: allowCam = $currentRoom?.type === RoomType.Video
</script>
<AppItem
{label}
{icon}
icon={$isSharingEnabled
? love.icon.SharingDisabled
: $isConnected && allowCam && !$isCameraEnabled && !$isMicEnabled
? love.icon.CamDisabled
: $isConnected && !allowCam && !$isMicEnabled
? love.icon.MicDisabled
: !allowCam || (!$isCameraEnabled && $isMicEnabled)
? love.icon.Mic
: icon}
{selected}
{size}
kind={$isSharingEnabled

View File

@ -119,7 +119,7 @@
}
&.accented,
&.accented.selected {
background-color: var(--global-disabled-PriorityColor);
background-color: var(--button-secondary-active-BackgroundColor);
}
&.positive .icon-container,
&.negative .icon-container,