-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
69 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<script setup lang="ts"> | ||
import type { inferRouterOutputs } from '@trpc/server' | ||
import type { AppRouter } from '@/server/trpc/routers' | ||
type RouterOutput = inferRouterOutputs<AppRouter> | ||
type ModuleOutput = RouterOutput['module']['get'] | ||
type Module = Exclude<ModuleOutput, null> | ||
interface Props { | ||
module: Module | ||
} | ||
const props = defineProps<Props>() | ||
</script> | ||
|
||
<template> | ||
<div class="module shu-card p-3 flex flex-col"> | ||
<div class="flex flex-row items-center pt-1 pb-3 gap-2 px-2"> | ||
<div class="w-5 h-5 block rounded-full overflow-hidden"> | ||
<LinkIcon :url="props.module.url" /> | ||
</div> | ||
<div> | ||
{{ formatDateTime(module.date) }} | ||
</div> | ||
</div> | ||
<div v-if="props.module.image" class="shadow-sm border rounded-2xl relative overflow-hidden"> | ||
<NuxtImg | ||
class="w-full" format="webp" :src="props.module!.image" :alt="module.title" | ||
referrerpolicy="no-referrer" loading="lazy" width="420px" | ||
/> | ||
<div class="absolute bottom-0 left-0 px-5 pt-5 pb-4 bg-gradient-to-t from-black/35 to-transparent w-full"> | ||
<h3 class="drop-shadow-md text-white font-bold text-2xl tracking-tight"> | ||
{{ props.module.title }} | ||
</h3> | ||
</div> | ||
</div> | ||
</div> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
import dayjs from 'dayjs' | ||
|
||
export function formatDateTime(source: string | number) { | ||
return dayjs(source).format('YYYY-MM-DD') | ||
return dayjs(source).format('MMMM DD, YYYY'); | ||
} |