diff --git a/components/headline-bar.tsx b/components/headline-bar.tsx index 34166a6..19b76b8 100644 --- a/components/headline-bar.tsx +++ b/components/headline-bar.tsx @@ -3,7 +3,15 @@ import { useEffect, useState } from 'react' import Link from 'next/link' -type HeadlineMessage = { label: string; text: string; href: string; /** Shown instead of `text` on phones, where the bar has one line */ shortText?: string } +type HeadlineMessage = { + label: string + text: string + href: string + /** Shown instead of `text` on phones, where the bar has one line */ + shortText?: string + /** A second link beside the message, for example the partner's own page */ + secondary?: { label: string; href: string } +} // Add an entry here to show a banner. Leave the array empty to hide the bar. // Past entries, for reference: @@ -15,9 +23,40 @@ const messages: HeadlineMessage[] = [ text: 'Qantara, the Palestinian AI Fellowship, is coming. We are excited to be a partner.', shortText: "Qantara is coming. We're excited!", href: '/qantara', + secondary: { label: 'EmpactUs', href: 'https://empactus.org.uk/qantara-the-palestinian-ai-fellowship/' }, }, ] +/** One banner message: the main link, and an optional second link beside it */ +function Row({ message, animation }: { message: HeadlineMessage; animation: string }) { + return ( +
+ + + {message.label} + + {message.text} + {message.shortText ?? message.text} + + {message.secondary && ( + + {message.secondary.label} + + )} +
+ ) +} + export function HeadlineBar() { const [activeIndex, setActiveIndex] = useState(0) const [leavingIndex, setLeavingIndex] = useState(null) @@ -54,32 +93,10 @@ export function HeadlineBar() {
{leavingMessage && ( - - - {leavingMessage.label} - - {leavingMessage.text} - {leavingMessage.shortText ?? leavingMessage.text} - + )} - - - {activeMessage.label} - - {activeMessage.text} - {activeMessage.shortText ?? activeMessage.text} - +