From f39421f894048a5ad3ab410ae3cc105fbdb3e34d Mon Sep 17 00:00:00 2001
From: Fuwn <contact@fuwn.me>
Date: Sat, 17 Feb 2024 20:38:17 -0800
Subject: feat(events): avatar for all events

---
 src/lib/Events/Event.svelte | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

(limited to 'src/lib/Events/Event.svelte')

diff --git a/src/lib/Events/Event.svelte b/src/lib/Events/Event.svelte
index 986db071..9905cd4b 100644
--- a/src/lib/Events/Event.svelte
+++ b/src/lib/Events/Event.svelte
@@ -1,8 +1,10 @@
 <script lang="ts">
 	import type { Event } from '$lib/Database/events';
+	import root from '$lib/Utility/root';
 	import locale from '$stores/locale';
 
 	export let event: Event;
+	export let avatar = false;
 </script>
 
 <a href={event.anilist_url} target="_blank">
@@ -16,6 +18,14 @@
 		{/if}
 
 		<div class="card" id="user-grid-content">
+			{#if avatar}
+				<div id="user-grid-avatar">
+					<a href={root(`/events/group/${event.group.anilist_username}`)}>
+						<img src={event.group.avatar} alt="" width="100vw" id="avatar" />
+					</a>
+				</div>
+			{/if}
+
 			<div id="user-grid-content-text">
 				<p>
 					<a href={event.anilist_url} target="_blank" class="title-text">
@@ -46,6 +56,17 @@
 		margin: 0 0.625rem;
 	} */
 
+	#user-grid-avatar {
+		display: flex;
+		flex-direction: column;
+		justify-content: center;
+		align-items: center;
+	}
+
+	#avatar {
+		border-radius: 8px;
+	}
+
 	#user-grid {
 		background-size: cover;
 		background-position: center;
-- 
cgit v1.2.3

