diff --git a/src/controls/SessionSheet.tsx b/src/controls/SessionSheet.tsx index 28d51b4..a42c920 100644 --- a/src/controls/SessionSheet.tsx +++ b/src/controls/SessionSheet.tsx @@ -57,6 +57,7 @@ const SessionSheet: FC = ({ const hasDescription = useMemo(() => session.description.length > 0, [session.description]); const hasSpeakers = useMemo(() => session.speakers.length > 0, [session.speakers]); + const hasSlides = useMemo(() => session.slidesUrl && session.slidesUrl.length > 0, [session.slidesUrl]) const buildAdminActions = () => (
@@ -123,7 +124,21 @@ const SessionSheet: FC = ({ } } - if (!hasDescription && !hasSpeakers) { + const formatSlidesUrl = () => { + if (!session.slidesUrl) return null; + + var text = session.slidesUrl; + const length = 30; + if (text.length > length) { + text = text.substring(0, length - 3) + "..." + } + + return ( + Presentation slides + ); + } + + if (!hasDescription && !hasSpeakers && !hasSlides) { return ( {isEditMode ? buildAdminActions() : null} @@ -139,8 +154,10 @@ const SessionSheet: FC = ({
+ { hasSlides ?
{formatSlidesUrl()}
: null } + { hasSlides && hasDescription ?
: null } { hasDescription ?
: null } - { hasDescription && hasSpeakers ? : null } + { (hasDescription || hasSlides) && hasSpeakers ? : null } { hasSpeakers ?
diff --git a/src/models/session.ts b/src/models/session.ts index 7e1eb53..d020978 100644 --- a/src/models/session.ts +++ b/src/models/session.ts @@ -4,6 +4,7 @@ export interface Session { name: string; type: string; location?: string; + slidesUrl?: string; speakers: string[]; description: string; isUnscheduled?: boolean;