Skip to content

Commit

Permalink
various UI/UX fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
MikeRomaa committed Mar 20, 2024
1 parent 2092e5d commit b536c0e
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 28 deletions.
24 changes: 9 additions & 15 deletions src/app/(home)/HomepageCards.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -22,17 +20,13 @@ export const AnnouncementCard: React.FC<AnnouncementCardProps> = ({ announcement
return (
<>
<Card interactive onClick={() => setShowModal(true)}>
<div className="mb-3 flex w-full gap-5">
<h4 className="w-full shrink truncate text-xl font-bold">
<div className="flex w-full items-center">
<p className="inline-block w-32 whitespace-pre text-gray-400">
{format(new Date(announcement.posted), 'MMM d, y')}
</p>
<h4 className="w-full shrink truncate text-lg font-medium">
{announcement.title}
</h4>
<Badge className="ml-auto">{format(new Date(announcement.posted), 'MMM d, y')}</Badge>
</div>
<div className="flex items-center gap-2">
<ProfilePicture user={announcement.author} size={40} />
<span className="font-medium">
{announcement.author.first_name} {announcement.author.last_name}
</span>
</div>
</Card>
<ClientPortal>
Expand All @@ -55,17 +49,17 @@ export const EventCard: React.FC<EventCardProps> = ({ event }) => (
<Card interactive>
<div className="grid grid-cols-2">
<div>
<h4 className="text-ellipsis whitespace-nowrap text-xl font-bold">{event.name}</h4>
<h5 className="mb-5 text-ellipsis whitespace-nowrap text-lg font-medium text-slate-400">
<h4 className="text-ellipsis whitespace-nowrap text-lg font-medium">{event.name}</h4>
<h5 className="mb-5 text-ellipsis whitespace-nowrap text-slate-400">
Presented by {event.host}
</h5>
<div className="mb-3 flex items-center gap-3">
<LuCalendar size={23} />
<span className="font-medium">{format(new Date(event.start), 'MMM d, y')}</span>
{format(new Date(event.start), 'MMM d, y')}
</div>
<div className="flex items-center gap-3">
<LuClock size={23} />
<span className="flex items-center gap-1.5 font-medium">
<span className="flex items-center gap-1.5">
{format(new Date(event.start), 'HH:mm zzz')}
<LuArrowRight />
{format(new Date(event.end), 'HH:mm zzz')}
Expand Down
8 changes: 3 additions & 5 deletions src/app/(home)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ const Home: NextPage = async () => {
<div className="ml-auto min-w-[50%]">
<h2 className="mb-5 text-3xl font-medium">Who's Online?</h2>
<div className="flex flex-col gap-3">
{onlineConnections.length === 0 && <p>Nobody is online.</p>}
{onlineConnections.length === 0 && <p>Nobody 😢</p>}
{onlineConnections.map((connection) => (
<div key={connection.id} className="flex items-center gap-3">
<Badge>{connection.callsign}</Badge>
Expand All @@ -111,17 +111,15 @@ const Home: NextPage = async () => {

<div className="mb-16 grid grid-cols-2 gap-10">
<div>
<h2 className="text-3xl font-medium">Announcements</h2>
<h3 className="mb-5 font-medium text-slate-400">What's happening at Houston?</h3>
<h2 className="mb-5 text-3xl font-medium">Announcements</h2>
<div className="flex flex-col gap-5">
{recentAnnouncements.map((announcement) => (
<AnnouncementCard key={announcement.id} announcement={announcement} />
))}
</div>
</div>
<div>
<h2 className="text-3xl font-medium">Events</h2>
<h3 className="mb-5 font-medium text-slate-400">Are y'all busy?</h3>
<h2 className="mb-5 text-3xl font-medium">Events</h2>
<div className="flex flex-col gap-5">
{upcomingEvents.length === 0 && <p>There are no published events, check back later.</p>}
{upcomingEvents.map((event) => (
Expand Down
2 changes: 1 addition & 1 deletion src/app/events/[id]/ShiftRequestButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ export const ShiftRequestButton: React.FC<ShiftRequestButtonProps> = ({ shift, r
}, [shift, requested]);

return (
<button className="h-full w-full text-center" onClick={toggleRequest} type="button">
<button className="size-full text-center" onClick={toggleRequest} type="button">
{requested ? 'Unrequest' : 'Request'}
</button>
);
Expand Down
2 changes: 1 addition & 1 deletion src/app/events/[id]/edit/editEventSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(),
Expand Down
4 changes: 3 additions & 1 deletion src/app/events/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ const ViewEvent: NextPage<EventParams> = async ({ params }) => {
</div>
)}
</div>
<img src={event.banner} alt={event.name} />
{event.banner && (
<img src={event.banner} alt={event.name} />
)}
</div>
<div className="grid grid-cols-3 gap-5">
<EventPositions
Expand Down
2 changes: 1 addition & 1 deletion src/app/events/new/newEventSchema.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { z } from 'zod';
export const newEventSchema = z.object({
name: z.string().min(1, 'Required'),
host: z.string().min(1, 'Required'),
banner: z.string(),
banner: z.string().optional(),
description: z.string(),

preset: z.object({
Expand Down
1 change: 1 addition & 0 deletions src/app/roster/[cid]/ProfileTables.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const ConnectionsTable: React.FC<ConnectionsTable> = ({ data }) => (
defaultSortFieldId={1}
defaultSortAsc={false}
sortIcon={<LuChevronDown />}
customStyles={dataTableStyle}
columns={[
{
name: 'Date',
Expand Down
4 changes: 2 additions & 2 deletions src/components/Card.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ interface CardProps extends HTMLProps<HTMLDivElement> {
export const Card: React.FC<CardProps> = ({ className, interactive, children, ...props }) => (
<div
className={classNames(
'rounded-md bg-white p-5 shadow transition-all duration-500 ease-out',
{ 'cursor-pointer hover:-translate-y-2 hover:opacity-90 hover:shadow-lg': interactive },
'rounded-md bg-white px-5 py-4 shadow transition-all duration-500 ease-out overflow-clip',
{ 'cursor-pointer hover:-translate-y-1 hover:opacity-90 hover:shadow-lg': interactive },
className,
)}
{...props}
Expand Down
4 changes: 2 additions & 2 deletions src/utils/dataTableStyle.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,13 @@ export const dataTableStyle = {
backgroundColor: '#e5e5e5!important',
outline: 'none!important',
},
'fontSize': '1rem',
'fontSize': '0.9rem',
},
},
headRow: {
style: {
backgroundColor: 'transparent',
fontSize: '1rem',
fontSize: '0.9rem',
},
},
headCells: {
Expand Down

0 comments on commit b536c0e

Please sign in to comment.