feat: mobile ui (#1096)

This commit is contained in:
Jonas Plum
2024-08-07 22:18:59 +02:00
committed by GitHub
parent 96b7a9604c
commit a2dd6c05e6
68 changed files with 668 additions and 1315 deletions

View File

@@ -1,22 +0,0 @@
<script setup lang="ts">
import type { HTMLAttributes } from 'vue'
import { cn } from '@/lib/utils'
const props = defineProps<{
class?: HTMLAttributes['class']
}>()
</script>
<template>
<div
:class="
cn(
'flex w-full items-center border-t px-2 py-1 first:rounded-t first:border-none last:rounded-b',
props.class
)
"
>
<slot />
</div>
</template>

View File

@@ -1,49 +0,0 @@
<script setup lang="ts">
import { formatDistanceToNow } from 'date-fns'
import { cn } from '@/lib/utils'
defineProps<{
title: string
subtitle: string
description: string
created: string
open: boolean
active: boolean
to: string | { name: string; params: Record<string, string | number> }
}>()
</script>
<template>
<RouterLink
:class="
cn(
'flex flex-col items-start gap-2 rounded-lg border bg-card p-3 text-left text-sm transition-all hover:bg-accent',
active && 'bg-accent'
)
"
:to="to"
>
<div class="flex w-full flex-col gap-1">
<div class="flex items-center">
<div class="flex items-center gap-2">
<div class="font-semibold">
{{ title }}
</div>
<span v-if="open" class="flex h-2 w-2 rounded-full bg-blue-600" />
</div>
<div :class="cn('ml-auto text-xs', active ? 'text-foreground' : 'text-muted-foreground')">
{{ formatDistanceToNow(new Date(created), { addSuffix: true }) }}
</div>
</div>
<div v-if="subtitle" class="text-xs font-medium">
{{ subtitle }}
</div>
</div>
<div v-if="description" class="line-clamp-2 text-xs text-muted-foreground">
{{ description }}
</div>
</RouterLink>
</template>