From b536c0e7425510b7f8cf88b8571da5342fadaf24 Mon Sep 17 00:00:00 2001 From: Michael Romashov Date: Tue, 19 Mar 2024 22:42:50 -0400 Subject: [PATCH] various UI/UX fixes --- src/app/(home)/HomepageCards.tsx | 24 ++++++++------------- src/app/(home)/page.tsx | 8 +++---- src/app/events/[id]/ShiftRequestButton.tsx | 2 +- src/app/events/[id]/edit/editEventSchema.ts | 2 +- src/app/events/[id]/page.tsx | 4 +++- src/app/events/new/newEventSchema.ts | 2 +- src/app/roster/[cid]/ProfileTables.tsx | 1 + src/components/Card.tsx | 4 ++-- src/utils/dataTableStyle.ts | 4 ++-- 9 files changed, 23 insertions(+), 28 deletions(-) diff --git a/src/app/(home)/HomepageCards.tsx b/src/app/(home)/HomepageCards.tsx index c54231c..c6d5390 100644 --- a/src/app/(home)/HomepageCards.tsx +++ b/src/app/(home)/HomepageCards.tsx @@ -5,9 +5,7 @@ import Link from 'next/link'; import { format } from 'date-fns-tz'; import { LuArrowRight, LuCalendar, LuClock } from 'react-icons/lu'; import { AnnouncementModal } from '@/components/AnnouncementModal'; -import { Badge } from '@/components/Badge'; import { Card } from '@/components/Card'; -import { ProfilePicture } from '@/components/ProfilePicture'; import { ClientPortal } from '@/components/ClientPortal'; import { type Announcement } from '@/types/announcements'; import { type BasicEvent } from '@/types/events'; @@ -22,17 +20,13 @@ export const AnnouncementCard: React.FC = ({ announcement return ( <> setShowModal(true)}> -
-

+
+

+ {format(new Date(announcement.posted), 'MMM d, y')} +

+

{announcement.title}

- {format(new Date(announcement.posted), 'MMM d, y')} -
-
- - - {announcement.author.first_name} {announcement.author.last_name} -
@@ -55,17 +49,17 @@ export const EventCard: React.FC = ({ event }) => (
-

{event.name}

-
+

{event.name}

+
Presented by {event.host}
- {format(new Date(event.start), 'MMM d, y')} + {format(new Date(event.start), 'MMM d, y')}
- + {format(new Date(event.start), 'HH:mm zzz')} {format(new Date(event.end), 'HH:mm zzz')} diff --git a/src/app/(home)/page.tsx b/src/app/(home)/page.tsx index 0aae8fd..f12a4b2 100644 --- a/src/app/(home)/page.tsx +++ b/src/app/(home)/page.tsx @@ -96,7 +96,7 @@ const Home: NextPage = async () => {

Who's Online?

- {onlineConnections.length === 0 &&

Nobody is online.

} + {onlineConnections.length === 0 &&

Nobody 😢

} {onlineConnections.map((connection) => (
{connection.callsign} @@ -111,8 +111,7 @@ const Home: NextPage = async () => {
-

Announcements

-

What's happening at Houston?

+

Announcements

{recentAnnouncements.map((announcement) => ( @@ -120,8 +119,7 @@ const Home: NextPage = async () => {
-

Events

-

Are y'all busy?

+

Events

{upcomingEvents.length === 0 &&

There are no published events, check back later.

} {upcomingEvents.map((event) => ( diff --git a/src/app/events/[id]/ShiftRequestButton.tsx b/src/app/events/[id]/ShiftRequestButton.tsx index a881dce..e5be5db 100644 --- a/src/app/events/[id]/ShiftRequestButton.tsx +++ b/src/app/events/[id]/ShiftRequestButton.tsx @@ -25,7 +25,7 @@ export const ShiftRequestButton: React.FC = ({ shift, r }, [shift, requested]); return ( - ); diff --git a/src/app/events/[id]/edit/editEventSchema.ts b/src/app/events/[id]/edit/editEventSchema.ts index 795d963..fc7fa32 100644 --- a/src/app/events/[id]/edit/editEventSchema.ts +++ b/src/app/events/[id]/edit/editEventSchema.ts @@ -5,7 +5,7 @@ import { z } from 'zod'; export const editEventSchema = z.object({ name: z.string().min(1, 'Required'), host: z.string().min(1, 'Required'), - banner: z.string(), + banner: z.string().optional(), description: z.string(), start: z.date(), diff --git a/src/app/events/[id]/page.tsx b/src/app/events/[id]/page.tsx index fc99800..fcf7aaf 100644 --- a/src/app/events/[id]/page.tsx +++ b/src/app/events/[id]/page.tsx @@ -97,7 +97,9 @@ const ViewEvent: NextPage = async ({ params }) => {
)}
- {event.name} + {event.banner && ( + {event.name} + )}
= ({ data }) => ( defaultSortFieldId={1} defaultSortAsc={false} sortIcon={} + customStyles={dataTableStyle} columns={[ { name: 'Date', diff --git a/src/components/Card.tsx b/src/components/Card.tsx index 18fbe32..59ba405 100644 --- a/src/components/Card.tsx +++ b/src/components/Card.tsx @@ -8,8 +8,8 @@ interface CardProps extends HTMLProps { export const Card: React.FC = ({ className, interactive, children, ...props }) => (