From 0aab88d1eee6fa7c651708716c6b9cf595f3249b Mon Sep 17 00:00:00 2001 From: AML - A Laycock Date: Mon, 29 Jan 2024 19:31:35 +0000 Subject: [PATCH] feat: display description --- app/routes/admin.live.add.tsx | 8 +------- app/routes/admin.live.tsx | 20 +------------------ app/routes/live.tsx | 15 +++++++++++++- .../migration.sql | 3 +++ prisma/schema.prisma | 12 ++++++----- 5 files changed, 26 insertions(+), 32 deletions(-) create mode 100644 prisma/migrations/20240129193019_add_dates_to_live_streams/migration.sql diff --git a/app/routes/admin.live.add.tsx b/app/routes/admin.live.add.tsx index ff97294..a222612 100644 --- a/app/routes/admin.live.add.tsx +++ b/app/routes/admin.live.add.tsx @@ -2,15 +2,9 @@ import { type ActionFunctionArgs, type LoaderFunctionArgs, json, - redirect, - unstable_parseMultipartFormData, - unstable_composeUploadHandlers, - unstable_createFileUploadHandler, - unstable_createMemoryUploadHandler + redirect } from '@remix-run/node' import {invariant} from '@arcath/utils' -import {v4 as uuid} from 'uuid' -import path from 'path' import {getUserFromUPN, getUPNFromHeaders} from '~/lib/user.server' import {getPrisma} from '~/lib/prisma' diff --git a/app/routes/admin.live.tsx b/app/routes/admin.live.tsx index 50e9fa4..a1634c4 100644 --- a/app/routes/admin.live.tsx +++ b/app/routes/admin.live.tsx @@ -1,28 +1,10 @@ -import { - type LoaderFunctionArgs, - type ActionFunctionArgs, - json, - redirect, - type HeadersArgs -} from '@remix-run/node' +import {type LoaderFunctionArgs, json, type HeadersArgs} from '@remix-run/node' import {useLoaderData, Outlet} from '@remix-run/react' -import {invariant} from '@arcath/utils' import {getUPNFromHeaders, getUserFromUPN} from '~/lib/user.server' import {getPrisma} from '~/lib/prisma' import {createTimings, combineServerTimingHeaders} from '~/utils/timings.server' -import {log} from '~/log.server' - -import { - fieldsetClasses, - labelClasses, - inputClasses, - buttonClasses, - labelSpanClasses, - labelInfoClasses -} from '~/lib/classes' - export const loader = async ({request}: LoaderFunctionArgs) => { const {time, getHeader} = createTimings() diff --git a/app/routes/live.tsx b/app/routes/live.tsx index a885a46..f78221e 100644 --- a/app/routes/live.tsx +++ b/app/routes/live.tsx @@ -8,6 +8,7 @@ import {getUPNFromHeaders, getUserFromUPN} from '~/lib/user.server' import {getConfigValue} from '~/lib/config.server' import {getPrisma} from '~/lib/prisma' import {buttonClasses} from '~/lib/classes' +import {getMDXComponent} from '~/lib/mdx' export const loader = async ({request}: LoaderFunctionArgs) => { const user = await getUserFromUPN(getUPNFromHeaders(request)) @@ -69,12 +70,24 @@ const Live = () => { if (!start) { return ( -
+

Live Streams

+ {streams.length === 0 ? ( +
+ There are no streams currently running. +
+ ) : ( + '' + )} {streams.map(stream => { + const Description = getMDXComponent(stream.descriptionCache) + return (

{stream.title}

+
+ +