- Updated BackgroundImage.astro to format props for better readability. - Adjusted FightTable.svelte to remove unnecessary trailing commas. - Modified GroupTable.svelte to fix sorting syntax. - Cleaned up LanguageWarning.astro by standardizing import statements. - Enhanced Login.svelte for better formatting and readability. - Simplified Navbar.svelte by merging multi-line attributes into single lines. - Streamlined PostComponent.astro by condensing Image component props. - Improved SearchComponent.svelte for consistent spacing and formatting. - Refined TagComponent.astro for better readability and structure. - Updated PageLayout.astro to simplify div structure. - Enhanced downloads.astro for improved readability and consistency. - Cleaned up index.astro in help directory for better formatting. - Refactored index.astro in main pages for improved readability. - Standardized login.astro for better formatting. - Cleaned up not-found.astro for consistent import formatting. - Enhanced [...schem].astro for better readability. - Refactored [mode].astro for consistent import formatting. - Improved [...gamemode].astro for better readability. - Cleaned up [mode].astro in regeln directory for consistent formatting. - Refactored index.astro in regeln directory for improved readability. - Enhanced fight.astro for consistent import formatting.
56 lines
2.1 KiB
Plaintext
56 lines
2.1 KiB
Plaintext
---
|
|
import type { CollectionEntry } from "astro:content";
|
|
import { l } from "../util/util";
|
|
import { astroI18n } from "astro-i18n";
|
|
import { Image } from "astro:assets";
|
|
import TagComponent from "./TagComponent.astro";
|
|
import P from "./P.astro";
|
|
import Card from "@components/Card.svelte";
|
|
|
|
interface Props {
|
|
post: CollectionEntry<"announcements">;
|
|
}
|
|
|
|
const {
|
|
post,
|
|
slim,
|
|
}: {
|
|
post: CollectionEntry<"announcements">;
|
|
slim: boolean;
|
|
} = Astro.props as Props;
|
|
|
|
const postUrl = l(`/announcements/${post.slug.split("/").slice(1).join("/")}`);
|
|
---
|
|
|
|
<Card extraClasses={`w-full items-start mx-0 ${slim ? "m-0 p-2 backdrop-blur-xl bg-transparent border-0" : "border-t-2 border-t-amber-500/30"}`} hoverEffect={false}>
|
|
<div class={`flex flex-row ${slim ? "" : "p-4"}`}>
|
|
{
|
|
post.data.image != null ? (
|
|
<a href={postUrl}>
|
|
<div class="flex-shrink-0 pr-2">
|
|
<Image transition:name={post.data.title + "-image"} src={post.data.image} alt="Post Image" class="object-cover h-32 w-32 max-w-none transition-transform hover:scale-105" />
|
|
</div>
|
|
</a>
|
|
) : null
|
|
}
|
|
<div>
|
|
<a href={postUrl} class="flex flex-col items-start">
|
|
<h2 class="text-2xl font-bold" style="font-family: 'Barlow Condensed', sans-serif; letter-spacing: 0.04em;" transition:name={post.data.title + "-title"}>{post.data.title}</h2>
|
|
<P class="text-gray-500 text-sm"
|
|
>{
|
|
Intl.DateTimeFormat(astroI18n.locale, {
|
|
day: "numeric",
|
|
month: "long",
|
|
year: "numeric",
|
|
}).format(post.data.created)
|
|
}</P
|
|
>
|
|
<P>{post.data.description}</P>
|
|
</a>
|
|
<div class="mt-1" transition:name={post.data.title + "-tags"}>
|
|
{post.data.tags.map((tag) => <TagComponent tag={tag} />)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</Card>
|