Show announcements on index page.
parent
0184eff590
commit
309f8a3afc
|
@ -11,17 +11,18 @@ import { VideoOnDemandIndex } from '../util/datatypes/VideoOnDemandIdentifier';
|
|||
import { getIndex } from '../util/api';
|
||||
|
||||
export async function getServerSideProps() {
|
||||
// Fetch VOD IDs
|
||||
const { ids } = await getIndex();
|
||||
// Fetch VOD IDs and announcements
|
||||
const { announcements, ids } = await getIndex();
|
||||
|
||||
return {
|
||||
props: {
|
||||
announcements,
|
||||
ids,
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default function Home({ ids }: VideoOnDemandIndex) {
|
||||
export default function Home({ announcements, ids }: VideoOnDemandIndex) {
|
||||
const intl = useIntl();
|
||||
return (
|
||||
<div>
|
||||
|
@ -62,6 +63,14 @@ export default function Home({ ids }: VideoOnDemandIndex) {
|
|||
/>
|
||||
</p>
|
||||
|
||||
{
|
||||
announcements.map(announcement => (
|
||||
<p>
|
||||
<b>Announcement:</b> {announcement}
|
||||
</p>
|
||||
))
|
||||
}
|
||||
|
||||
<ListGroup>
|
||||
{ids.map(({ id, title }) => (
|
||||
<Link key={id} passHref href="/[id]" as={`/${id}`}>
|
||||
|
|
Loading…
Reference in New Issue