misc: specify desktop-only items
This commit is contained in:
1 parent
ae1a3bffc0
commit
5f34a102c3
6 files changed
+141
-49
No files matched your search
@@ -1,12 +1,47 @@
|
||||
<script lang="ts">
|
||||
import { Switch } from 'mono-svelte'
|
||||
import { t } from '$lib/translations'
|
||||
import { Badge, Switch } from 'mono-svelte'
|
||||
import {
|
||||
ComputerDesktop,
|
||||
DevicePhoneMobile,
|
||||
DeviceTablet,
|
||||
Icon,
|
||||
} from 'svelte-hero-icons'
|
||||
|
||||
export let title: string
|
||||
export let description: string | undefined = undefined
|
||||
export let checked: boolean = false
|
||||
|
||||
export let supportedPlatforms = {
|
||||
desktop: true,
|
||||
tablet: true,
|
||||
mobile: true,
|
||||
}
|
||||
</script>
|
||||
|
||||
<div class="flex flex-row items-center w-full justify-between gap-4 max-w-full">
|
||||
<div class="flex flex-col w-full justify-between gap-2 max-w-full">
|
||||
{#if Object.values(supportedPlatforms).some((v) => v == false)}
|
||||
<div class="flex items-center gap-2 flex-wrap">
|
||||
{#if supportedPlatforms.desktop}
|
||||
<Badge>
|
||||
<Icon src={ComputerDesktop} micro size="14" slot="icon" />
|
||||
{$t('settings.desktop')}
|
||||
</Badge>
|
||||
{/if}
|
||||
{#if supportedPlatforms.tablet}
|
||||
<Badge>
|
||||
<Icon src={DeviceTablet} micro size="14" slot="icon" />
|
||||
{$t('settings.tablet')}
|
||||
</Badge>
|
||||
{/if}
|
||||
{#if supportedPlatforms.mobile}
|
||||
<Badge>
|
||||
<Icon src={DevicePhoneMobile} micro size="14" slot="icon" />
|
||||
{$t('settings.mobile')}
|
||||
</Badge>
|
||||
{/if}
|
||||
</div>
|
||||
{/if}
|
||||
<Switch
|
||||
bind:checked
|
||||
class="flex-row-reverse items-center w-full"
|
||||
|
||||
Reference in new issue
Block a user