Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 | 2x 2x 2x 2x 2x 2x 2x 2x 2x | import { TopNav } from './TopNav'
import Menu from './Menu'
import Image from 'next/image'
import logoFile from '../public/sig-blk-en.svg'
import logoFileFR from '../public/sig-blk-fr.svg'
import Language from './Language'
import Breadcrumb from './Breadcrumb'
interface SearchProps {
onChange: () => void
onSubmit: () => void
}
interface MenuProps {
onSignOut?: () => void
menuList: MenuList[]
inboxLink: string
}
interface MenuList {
id: string
key: string
value: string
path: string
showIcon?: boolean
onSignOut?: () => void
}
interface TopNavProps {
skipToMainPath: string
skipToAboutPath: string
switchToBasicPath: string
displayAlternateLink: boolean
}
export interface BreadcrumbItemProps {
text: string
link: string
}
interface HeaderProps {
id: string
lang: string
linkPath: string
searchProps: SearchProps
menuProps: MenuProps
topnavProps: TopNavProps
breadCrumbItems: BreadcrumbItemProps[]
refPageAA: string
dataGcAnalyticsCustomClickInstitutionVariable: string
dataGcAnalyticsCustomClickMenuVariable: string
}
const Header = ({
id = 'mscaPlaceholder',
lang = 'en',
linkPath,
menuProps = {
onSignOut: () => {},
menuList: [
{
id: 'dashId',
showIcon: false,
onSignOut: () => {},
key: 'dashKey',
value: 'My dashboard',
path: '/',
},
{
id: 'securityId',
showIcon: false,
onSignOut: () => {},
key: 'securityKey',
value: 'Security Settings',
path: '/',
},
{
id: 'profileId',
showIcon: false,
onSignOut: () => {},
key: 'profileKey',
value: 'Profile',
path: '/',
},
{
id: 'signOutId',
showIcon: true,
onSignOut: () => {},
key: 'outKey',
value: 'Sign out',
path: '/',
},
],
inboxLink: '/',
},
breadCrumbItems,
refPageAA = 'mscaPlaceholder',
topnavProps = {
skipToMainPath: '#wb-cont',
skipToAboutPath: '#wb-info',
switchToBasicPath: 'basic-en.html',
displayAlternateLink: false,
},
dataGcAnalyticsCustomClickInstitutionVariable,
dataGcAnalyticsCustomClickMenuVariable,
}: HeaderProps) => {
return (
<div className="font-display" id={id} data-testid="header">
<TopNav
lang={lang}
skipToMainPath={topnavProps.skipToMainPath}
skipToAboutPath={topnavProps.skipToAboutPath}
switchToBasicPath={topnavProps.switchToBasicPath}
displayAlternateLink={topnavProps.displayAlternateLink}
/>
<header>
<div className={`sch-container flex flex-col sm:flex-row md:pb-3.5`}>
<div className="flex flex-row sm:pt-3">
<div className="pt-1.5">
<Image
className={`${
lang === 'en'
? 'max-h-[19px] md:max-h-[34px]'
: 'max-h-[20px] md:max-h-[35px]'
} max-w-[206px] md:max-w-[360px]`}
src={lang === 'en' ? logoFile : logoFileFR}
alt={
lang === 'en'
? 'Government of Canada'
: 'Governement du Canada'
}
width={819}
height={76}
/>
<span className="sr-only" lang={lang === 'en' ? 'fr' : 'en'}>
{
/* Alt text for bilingual logo */
lang === 'en'
? 'Governement du Canada'
: 'Government of Canada'
}
</span>
</div>
<div className="ml-auto pb-2.5 sm:hidden">
<Language
id="lang2"
lang={lang}
path={linkPath}
abbr={lang === 'en' ? 'FR' : 'EN'}
dataGcAnalyticsCustomClick={
dataGcAnalyticsCustomClickInstitutionVariable
}
/>
</div>
</div>
<div className="md:ds-pt-4.5 hidden pb-2.5 sm:ml-auto sm:flex sm:pb-3.5 sm:pt-2.5 md:pb-0">
<Language
id="lang1"
lang={lang}
path={linkPath}
dataGcAnalyticsCustomClick={
dataGcAnalyticsCustomClickInstitutionVariable
}
/>
</div>
</div>
<Menu
lang={lang}
menuList={menuProps.menuList}
inboxLink={menuProps.inboxLink}
dataGcAnalyticsCustomClick={dataGcAnalyticsCustomClickMenuVariable}
/>
<div className="sch-container">
<Breadcrumb
items={breadCrumbItems}
refPageAA={refPageAA}
lang={lang}
/>
</div>
</header>
</div>
)
}
export default Header
|