Skip to content

Commit

Permalink
feat(ui): update public page styling
Browse files Browse the repository at this point in the history
  • Loading branch information
sentriz committed Dec 8, 2022
1 parent af7d43b commit 1e15eaf
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions web/components/Public.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
<div class="flex min-h-screen items-center bg-white">
<div class="container mx-auto space-y-6 p-6">
<div v-if="media" class="flex items-center justify-between">
<h1 class="text-gray-500">shared media</h1>
<badge-group label="uploaded" class="hidden text-gray-700 md:inline-flex" v-if="media && timestamp">
<h1 class="text-gray-700">shared media</h1>
<badge-group label="created on" class="hidden text-gray-500 md:inline-flex" v-if="media && timestamp">
<badge class="bg-pink-200 text-pink-900" :title="media.timestamp">{{ timestamp }}</badge>
</badge-group>
</div>
Expand Down Expand Up @@ -32,9 +32,12 @@ const requestMedia = async () => {
const media = computed(() => store.getMediaByHash(hash))
const timestamp = computed(() => {
if (!media.value) return
return new Date(media.value?.timestamp).toLocaleString()
const date = new Date(media.value?.timestamp)
return `${pad(date.getFullYear())}.${pad(date.getMonth())}.${pad(date.getDay())}`
})
const pad = (n: number): string => String(n).padStart(2, '0')
onMounted(requestMedia)
const socket = newSocket({ want_media_hash: hash })
Expand Down

0 comments on commit 1e15eaf

Please sign in to comment.