|
| 1 | +import { Sandbox } from "@components/sandbox"; |
| 2 | +import { CodeSnippet } from "@components/code-snippet/CodeSnippet.tsx"; |
| 3 | +import { GoabAppHeader, GoabAppHeaderMenu, GoabMicrositeHeader } from "@abgov/react-components"; |
| 4 | +import { useContext } from "react"; |
| 5 | +import { LanguageVersionContext } from "@contexts/LanguageVersionContext.tsx"; |
| 6 | + |
| 7 | +export const HeaderLoggedInMenu = () => { |
| 8 | + const {version} = useContext(LanguageVersionContext); |
| 9 | + return ( |
| 10 | + <Sandbox fullWidth skipRender> |
| 11 | + <GoabMicrositeHeader type="live"></GoabMicrositeHeader> |
| 12 | + <GoabAppHeader |
| 13 | + url="https://example.com" |
| 14 | + heading="Design System" |
| 15 | + fullMenuBreakpoint={1500}> |
| 16 | + <a href="#">Services</a> |
| 17 | + <GoabAppHeaderMenu heading="John Smith" leadingIcon="person-circle"> |
| 18 | + <a href="#">Manage account</a> |
| 19 | + <a href="#">Request new staff account</a> |
| 20 | + <a href="#">System admin</a> |
| 21 | + <a href="#" className="interactive">Sign out</a> |
| 22 | + </GoabAppHeaderMenu> |
| 23 | + </GoabAppHeader> |
| 24 | + |
| 25 | + {version === "old" && ( |
| 26 | + <CodeSnippet |
| 27 | + lang="html" |
| 28 | + tags="angular" |
| 29 | + allowCopy={true} |
| 30 | + code={` |
| 31 | + <goa-microsite-header type="live"></goa-microsite-header> |
| 32 | + <goa-app-header |
| 33 | + url="https://example.com" |
| 34 | + heading="Design System" |
| 35 | + [fullmenubreakpoint]="1500" |
| 36 | + [hasmenuclickhandler]="true" |
| 37 | + (_menuClick)="handleMenuClick()" |
| 38 | + > |
| 39 | + <a href="#">Services</a> |
| 40 | + <goa-app-header-menu heading="John Smith" leadingIcon="person-circle"> |
| 41 | + <a href="#">Manage account</a> |
| 42 | + <a href="#">Request new staff account</a> |
| 43 | + <a href="#">System admin</a> |
| 44 | + <a href="#" class="interactive">Sign out</a> |
| 45 | + </goa-app-header-menu> |
| 46 | + </goa-app-header> |
| 47 | + `} |
| 48 | + /> |
| 49 | + )} |
| 50 | + |
| 51 | + {version === "new" && ( |
| 52 | + <CodeSnippet |
| 53 | + lang="html" |
| 54 | + tags="angular" |
| 55 | + allowCopy={true} |
| 56 | + code={` |
| 57 | + <goab-microsite-header type="live"></goab-microsite-header> |
| 58 | + <goab-app-header |
| 59 | + url="https://example.com" |
| 60 | + heading="Design System" |
| 61 | + [fullMenuBreakpoint]="1500" |
| 62 | + (onMenuClick)="handleMenuClick()" |
| 63 | + > |
| 64 | + <a href="#">Services</a> |
| 65 | + <goab-app-header-menu heading="John Smith" leadingIcon="person-circle"> |
| 66 | + <a href="#">Manage account</a> |
| 67 | + <a href="#">Request new staff account</a> |
| 68 | + <a href="#">System admin</a> |
| 69 | + <a href="#" class="interactive">Sign out</a> |
| 70 | + </goab-app-header-menu> |
| 71 | + </goab-app-header> |
| 72 | + `} |
| 73 | + /> |
| 74 | + )} |
| 75 | + |
| 76 | + {version === "old" && ( |
| 77 | + <CodeSnippet |
| 78 | + lang="html" |
| 79 | + tags="react" |
| 80 | + allowCopy={true} |
| 81 | + code={` |
| 82 | + <GoAMicrositeHeader type="live"></GoAMicrositeHeader> |
| 83 | + <GoAAppHeader |
| 84 | + url="https://example.com" |
| 85 | + heading="Design System" |
| 86 | + onMenuClick={handleMenuClick} |
| 87 | + fullMenuBreakpoint={1500}> |
| 88 | + <a href="#">Services</a> |
| 89 | + <GoAAppHeaderMenu heading="John Smith" leadingIcon="person-circle"> |
| 90 | + <a href="#">Manage account</a> |
| 91 | + <a href="#">Request new staff account</a> |
| 92 | + <a href="#">System admin</a> |
| 93 | + <a href="#" className="interactive">Sign out</a> |
| 94 | + </GoAAppHeaderMenu> |
| 95 | + </GoAAppHeader> |
| 96 | + `} |
| 97 | + /> |
| 98 | + )} |
| 99 | + {version === "new" && ( |
| 100 | + <CodeSnippet |
| 101 | + lang="html" |
| 102 | + tags="react" |
| 103 | + allowCopy={true} |
| 104 | + code={` |
| 105 | + <GoabMicrositeHeader type="live"></GoabMicrositeHeader> |
| 106 | + <GoabAppHeader |
| 107 | + url="https://example.com" |
| 108 | + heading="Design System" |
| 109 | + onMenuClick={handleMenuClick} |
| 110 | + fullMenuBreakpoint={1500}> |
| 111 | + <a href="#">Services</a> |
| 112 | + <GoabAppHeaderMenu heading="John Smith" leadingIcon="person-circle"> |
| 113 | + <a href="#">Manage account</a> |
| 114 | + <a href="#">Request new staff account</a> |
| 115 | + <a href="#">System admin</a> |
| 116 | + <a href="#" className="interactive">Sign out</a> |
| 117 | + </GoabAppHeaderMenu> |
| 118 | + </GoabAppHeader> |
| 119 | + `} |
| 120 | + /> |
| 121 | + )} |
| 122 | + </Sandbox> |
| 123 | + ) |
| 124 | +} |
| 125 | + |
| 126 | +export default HeaderLoggedInMenu; |
0 commit comments