Merged PR 2269: added link for streaming events
added link for streaming events Related work items: #22423
This commit is contained in:
@@ -32,6 +32,10 @@ import {
|
||||
import { signIn, useSession } from "next-auth/react";
|
||||
import { destroyCookie, parseCookies, setCookie } from "nookies";
|
||||
import { getFormCollectionByID, getDetailsProxy } from "../utils";
|
||||
import {
|
||||
getLivePublishedEvent,
|
||||
isEventLiveNow
|
||||
} from "./summary/utils/liveEvent";
|
||||
|
||||
import * as CaseTypes from "./summaryTypes"; // ✅ must match filename exactly
|
||||
import {
|
||||
@@ -321,6 +325,10 @@ const CaseSummary = (props) => {
|
||||
Array.isArray(props.mediaObj?.value) &&
|
||||
props.mediaObj.value.length > 0;
|
||||
|
||||
const livePublishedEvent = hasEventsTabData
|
||||
? getLivePublishedEvent(props.eventsObj)
|
||||
: null;
|
||||
|
||||
let point = {};
|
||||
let siteCoords = {};
|
||||
let center = {};
|
||||
@@ -359,6 +367,45 @@ const CaseSummary = (props) => {
|
||||
showDetails == true ? (
|
||||
<>
|
||||
<div className="govuk-frontend-supported">
|
||||
{livePublishedEvent && (
|
||||
<div
|
||||
className="govuk-notification-banner govuk-!-margin-bottom-6"
|
||||
role="region"
|
||||
aria-labelledby="live-event-title"
|
||||
data-module="govuk-notification-banner"
|
||||
>
|
||||
<div className="govuk-notification-banner__header">
|
||||
<h2
|
||||
className="govuk-notification-banner__title"
|
||||
id="live-event-title"
|
||||
>
|
||||
Live event
|
||||
</h2>
|
||||
</div>
|
||||
<div className="govuk-notification-banner__content">
|
||||
<p className="govuk-notification-banner__heading">
|
||||
A live streamed event is happening now.
|
||||
</p>
|
||||
|
||||
{livePublishedEvent.pinswg_eventname && (
|
||||
<p className="govuk-body">
|
||||
{livePublishedEvent.pinswg_eventname}
|
||||
</p>
|
||||
)}
|
||||
|
||||
<a
|
||||
href={
|
||||
livePublishedEvent.pinswg_linktotheevent
|
||||
}
|
||||
className="govuk-link govuk-link--no-visited-state"
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
>
|
||||
Watch live stream
|
||||
</a>
|
||||
</div>
|
||||
</div>
|
||||
)}
|
||||
<div className="govuk-grid-row">
|
||||
<div className="govuk-grid-column-full">
|
||||
<h1 className="govuk-heading-xl govuk-!-margin-bottom-7">
|
||||
@@ -373,6 +420,7 @@ const CaseSummary = (props) => {
|
||||
</h1>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="govuk-tabs" data-module="govuk-tabs">
|
||||
<h2 className="govuk-tabs__title">Contents</h2>
|
||||
<ul className="govuk-tabs__list">
|
||||
|
||||
Reference in New Issue
Block a user