Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions app/events/EventCard.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,4 @@
import {
faClone,
faLock,
faPlus
} from "@fortawesome/free-solid-svg-icons"
import { faClone, faLock, faPlus } from "@fortawesome/free-solid-svg-icons"
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"
import clsx from "clsx"
import { useState } from "react"
Expand Down Expand Up @@ -68,7 +64,7 @@ export default function EventCard({
/>
)}
{event.name}
</div>
</div>
<div className={styles.tags}>
<div className={styles.type}>{event.eventType}</div>
{event.points > 0 && (
Expand All @@ -94,7 +90,9 @@ export default function EventCard({
</span>
</div>
</>
) : <></>}
) : (
<></>
)}
</div>
{event.locations.length > 0 && (
<div className={styles.location}>
Expand All @@ -109,7 +107,6 @@ export default function EventCard({
</div>
)}
</div>

</div>

<div className={styles.details}>
Expand All @@ -120,9 +117,12 @@ export default function EventCard({
</button>

<div className={styles.buttons}>
<button onClick={onDuplicate}>
<FontAwesomeIcon icon={faClone} fixedWidth />
</button>
{canEdit && (
<button onClick={onDuplicate}>
<FontAwesomeIcon icon={faClone} fixedWidth />
</button>
)}

<button onClick={() => setShowCodeForm(true)}>
<FontAwesomeIcon icon={faQrcode} fixedWidth />
</button>
Expand Down
52 changes: 30 additions & 22 deletions app/events/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,12 @@ import { faSync } from "@fortawesome/free-solid-svg-icons"
import { Box, Button, IconButton, Tab, Tabs } from "@mui/material"
import { Add } from "@mui/icons-material"

import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import tz from 'dayjs/plugin/timezone';
import dayjs from "dayjs"
import utc from "dayjs/plugin/utc"
import tz from "dayjs/plugin/timezone"

dayjs.extend(utc);
dayjs.extend(tz);
dayjs.extend(utc)
dayjs.extend(tz)

interface EventsForDay {
date: Date
Expand Down Expand Up @@ -122,36 +122,44 @@ export default function Events() {
return (
<div className={styles.container}>
<div className={styles.titles}>
<Tabs value={tabIndex} onChange={(_, idx) => setStaffView(idx === 0)}>
<Tabs
value={tabIndex}
onChange={(_, idx) => setStaffView(idx === 0)}
>
<Tab label="Staff Schedule" className={styles.tab} />
<Tab label="Attendee Schedule" className={styles.tab} />
</Tabs>
<Box>
<Button
variant="contained"
color="primary"
startIcon={<Add />}
sx={{ fontFamily: "Montserrat, Segoe UI, Roboto, sans-serif", marginRight: 1 }}
onClick={() => {
const local = dayjs()
.startOf('day') // sets hour/min/sec/ms → 0
.toDate();
setEditingDay(local);
setEditingEvent({})
}}
{isAdmin && (
<Button
variant="contained"
color="primary"
startIcon={<Add />}
sx={{
fontFamily:
"Montserrat, Segoe UI, Roboto, sans-serif",
marginRight: 1,
}}
onClick={() => {
const local = dayjs()
.startOf("day") // sets hour/min/sec/ms → 0
.toDate()
setEditingDay(local)
setEditingEvent({})
}}
>
Add Event
Add Event
</Button>
)}
<IconButton
onClick={fetchEvents}
aria-label="Refresh events"
>
>
<FontAwesomeIcon icon={faSync} />
</IconButton>
</Box>
</div>
<div>
</div>
<div></div>
<div className={styles["events-page"]}>
{editingEvent && (
<EventEditPopup
Expand Down