Skip to content

Commit

Permalink
fix: lint
Browse files Browse the repository at this point in the history
  • Loading branch information
Ethan-Chew committed Sep 28, 2023
1 parent 7a2e22e commit 4337bf0
Show file tree
Hide file tree
Showing 13 changed files with 420 additions and 400 deletions.
36 changes: 18 additions & 18 deletions components/admin/event/_slug.vue
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
<script setup lang="ts">
import { f7Link, f7NavLeft, f7NavTitle, f7Navbar, f7Page } from 'framework7-vue'
import { f7NavTitle, f7Navbar, f7Page } from 'framework7-vue'
import type { Router } from 'framework7/types'
const props = defineProps<{
f7route: Router.Route
f7route: Router.Route
}>()
const { data: user } = useUser()
const { data: event } = useEvent(props.f7route.params.id!)
const showForbidden = computed(() => {
if (!user.value) // Should load placeholder data
return false
return user.value.memberType !== 'exco'
if (!user.value) // Should load placeholder data
return false
return user.value.memberType !== 'exco'
})
</script>

<template>
<f7Page>
<f7Navbar back-link="Back">
<f7NavTitle>
Event Details
</f7NavTitle>
</f7Navbar>
<f7Page>
<f7Navbar back-link="Back">
<f7NavTitle>
Event Details
</f7NavTitle>
</f7Navbar>

<LazyAdminHomeForbidden v-if="showForbidden" />
<LazyAdminHomeForbidden v-if="showForbidden" />

<template v-else>
<AdminEventInformation :event="event" />
<template v-else>
<AdminEventInformation :event="event" />

<AdminEventUploadAttendees :event="event" />
<AdminEventUploadAttendees :event="event" />

<AdminEventCheckedinUsers :event="event" />
</template>
</f7Page>
<AdminEventCheckedinUsers :event="event" />
</template>
</f7Page>
</template>
28 changes: 14 additions & 14 deletions components/admin/event/event-checkedin-users.vue
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
<script setup lang="ts">
import { f7List, f7ListItem, f7Card, f7CardContent, f7CardHeader } from 'framework7-vue';
const props = defineProps(["event"])
import { f7Card, f7CardContent, f7CardHeader, f7List, f7ListItem } from 'framework7-vue'
const props = defineProps(['event'])
</script>

<template>
<f7Card>
<f7CardHeader>
<span class="font-semibold text-2xl">Attendees</span>
</f7CardHeader>
<f7CardContent>
<f7List v-for="attendee in props.event.attendees" media-list dividers-ios strong inset>
<f7ListItem :title="attendee.name" :subtitle="`ID: ${attendee.id}`">
</f7ListItem>
</f7List>
</f7CardContent>
</f7Card>
</template>
<f7Card>
<f7CardHeader>
<span class="font-semibold text-2xl">Attendees</span>
</f7CardHeader>
<f7CardContent>
<f7List v-for="attendee in props.event.attendees" :key="attendee.id" media-list dividers-ios strong inset>
<f7ListItem :title="attendee.name" :subtitle="`ID: ${attendee.id}`" />
</f7List>
</f7CardContent>
</f7Card>
</template>
81 changes: 41 additions & 40 deletions components/admin/event/event-information.vue
Original file line number Diff line number Diff line change
@@ -1,52 +1,53 @@
<script setup lang="ts">
import { f7Card, f7CardHeader, f7Chip, f7CardContent } from 'framework7-vue';
import { f7Card, f7CardContent } from 'framework7-vue'
const props = defineProps(["event"])
const props = defineProps(['event'])
function convertEpochToSGT(epochTime: number) {
const date = new Date(epochTime * 1000);
date.setUTCHours(date.getUTCHours() + 8);
const date = new Date(epochTime * 1000)
date.setUTCHours(date.getUTCHours() + 8)
const formattedDate = date.toLocaleDateString('en-SG', {
day: '2-digit',
month: '2-digit',
year: 'numeric',
});
const formattedDate = date.toLocaleDateString('en-SG', {
day: '2-digit',
month: '2-digit',
year: 'numeric',
})
const formattedTime = date.toLocaleTimeString('en-SG', {
hour: '2-digit',
minute: '2-digit',
});
const formattedTime = date.toLocaleTimeString('en-SG', {
hour: '2-digit',
minute: '2-digit',
})
return `${formattedDate} | ${formattedTime}`;
return `${formattedDate} | ${formattedTime}`
}
</script>

<template>
<f7Card>
<f7CardContent class="p-0! lg-rounded!">
<div class="relative">
<img :src="props.event.badgeImage" class="object-cover w-full max-h-60 object-top lg-rounded!">
<div class="p-10 absolute z-10 inset-0 flex flex-col bg-gray-800/[0.3] space-y-6 backdrop-blur-sm lg-rounded!">
<div class="space-y-3 flex flex-col">
<span class="font-bold text-3xl md:text-4xl">{{ props.event.name }}</span>
<div>
<div class="flex-inline shrink grow-0 p-1 px-4 border border-solid b-rounded-3">
{{ `0 / ${event.attendees.length} Attendees Checked-In` }}
</div>
</div>
</div>
<div class="text-lg flex flex-col">
<span><b>{{ convertEpochToSGT(props.event.startDateTime) }}</b> to <b>{{ convertEpochToSGT(props.event.endDateTime) }}</b></span>
<span><b>Location:</b> {{ props.event.location }}</span>
</div>
</div>
</div>
<div class="p-6 pb-3 pt-2">
<span class="text-xl font-bold">Description</span>
<p class="text-md mt-2">{{ props.event.description }}</p>
<f7Card>
<f7CardContent class="p-0! lg-rounded!">
<div class="relative">
<img :src="props.event.badgeImage" class="object-cover w-full max-h-60 object-top lg-rounded!">
<div class="p-10 absolute z-10 inset-0 flex flex-col bg-gray-800/[0.3] space-y-6 backdrop-blur-sm lg-rounded!">
<div class="space-y-3 flex flex-col">
<span class="font-bold text-3xl md:text-4xl">{{ props.event.name }}</span>
<div>
<div class="flex-inline shrink grow-0 p-1 px-4 border border-solid b-rounded-3">
{{ `0 / ${event.attendees.length} Attendees Checked-In` }}
</div>
</div>
</f7CardContent>
</f7Card>
</template>
</div>
<div class="text-lg flex flex-col">
<span><b>{{ convertEpochToSGT(props.event.startDateTime) }}</b> to <b>{{ convertEpochToSGT(props.event.endDateTime) }}</b></span>
<span><b>Location:</b> {{ props.event.location }}</span>
</div>
</div>
</div>
<div class="p-6 pb-3 pt-2">
<span class="text-xl font-bold">Description</span>
<p class="text-md mt-2">
{{ props.event.description }}
</p>
</div>
</f7CardContent>
</f7Card>
</template>
Loading

0 comments on commit 4337bf0

Please sign in to comment.