Skip to content

Commit

Permalink
Informative icons for the LOVE sidebar (#7275)
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Platov <alexander.platov@hardcoreeng.com>
  • Loading branch information
SasLord authored Dec 6, 2024
1 parent d9aa051 commit 596185b
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion plugins/workbench-resources/src/components/AppItem.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit 596185b

Please sign in to comment.