update type to enum and change css -> tailwindcss syntax + some ui change

This commit is contained in:
Minh Vo
2025-12-29 02:37:29 -05:00
parent 6ce42e7d36
commit 3e74ac4bcb
6 changed files with 116 additions and 105 deletions

View File

@@ -1,5 +1,5 @@
<script lang="ts">
import type { EventPost, Category } from '$lib/schemas';
import { type EventPost, EventCategory } from '$lib/schemas';
import Section from 'components/layout/Section.svelte';
import SeoMetaTags from 'components/layout/SeoMetaTags.svelte';
import EventTabsTrigger from 'components/event/EventTabsTrigger.svelte';
@@ -8,16 +8,16 @@
let { data } = $props();
let events: EventPost[] = data.events ?? [];
let group = $state<Category>('allEvents');
let categories: {value: Category; label: string}[] = [
{ value: 'allEvents', label: 'All Events' },
{ value: 'academic', label: 'Academic' },
{ value: 'professional', label: 'Professional' },
{ value: 'social', label: 'Social' },
{ value: 'technical', label: 'Technical' }
let group = $state<EventCategory>(EventCategory.ALL_EVENTS);
let categories: {value: EventCategory; label: string}[] = [
{ value: EventCategory.ALL_EVENTS, label: 'All Events' },
{ value: EventCategory.ACADEMIC, label: 'Academic' },
{ value: EventCategory.PROFESSIONAL, label: 'Professional' },
{ value: EventCategory.SOCIAL, label: 'Social' },
{ value: EventCategory.TECHNICAL, label: 'Technical' }
];
// Handle tab change
function handleTabChange(selectedCategory: Category) {
function handleTabChange(selectedCategory: EventCategory) {
group = selectedCategory;
}
</script>