diff options
author | Sebastian <sebasjm@gmail.com> | 2024-02-28 09:30:32 -0300 |
---|---|---|
committer | Sebastian <sebasjm@gmail.com> | 2024-02-28 09:30:32 -0300 |
commit | 6dd011d2f6092b1fb8eee16eb5f026faf07b802f (patch) | |
tree | 9b3bfc82c64e8d84734ce9dc682c20fb1c70a47e /packages/web-util/src | |
parent | 4c57d22def6d90fe4f4599fbd9b6e0586e6c3c02 (diff) | |
download | wallet-core-6dd011d2f6092b1fb8eee16eb5f026faf07b802f.tar.xz |
fix #0008537
Diffstat (limited to 'packages/web-util/src')
-rw-r--r-- | packages/web-util/src/components/Header.tsx | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/packages/web-util/src/components/Header.tsx b/packages/web-util/src/components/Header.tsx index 0b86418ec..fc7716320 100644 --- a/packages/web-util/src/components/Header.tsx +++ b/packages/web-util/src/components/Header.tsx @@ -3,8 +3,8 @@ import { LangSelector, useTranslationContext } from "../index.browser.js"; import { ComponentChildren, Fragment, VNode, h } from "preact"; import logo from "../assets/logo-2021.svg"; -export function Header({ title, iconLinkURL, sites, onLogout, children }: - { title: string, iconLinkURL: string, children?: ComponentChildren, onLogout: (() => void) | undefined, sites: Array<Array<string>>, supportedLangs: string[] }): VNode { +export function Header({ title, profileURL, iconLinkURL, sites, onLogout, children }: + { title: string, iconLinkURL: string, profileURL?: string, children?: ComponentChildren, onLogout: (() => void) | undefined, sites: Array<Array<string>>, supportedLangs: string[] }): VNode { const { i18n } = useTranslationContext(); const [open, setOpen] = useState(false) return <Fragment> @@ -35,6 +35,15 @@ export function Header({ title, iconLinkURL, sites, onLogout, children }: </div> </div> <div class="flex justify-end"> + {!profileURL ? undefined : + <a href={profileURL} name="profile" class="relative inline-flex items-center justify-center rounded-md bg-indigo-600 p-1 mr-2 text-indigo-200 hover:bg-indigo-500 hover:bg-opacity-75 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-indigo-600" aria-controls="mobile-menu" aria-expanded="false"> + <span class="absolute -inset-0.5"></span> + <span class="sr-only"><i18n.Translate>Open profile</i18n.Translate></span> + <svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke-width="1.5" stroke="currentColor" class="w-10 h-10"> + <path stroke-linecap="round" stroke-linejoin="round" d="M17.982 18.725A7.488 7.488 0 0 0 12 15.75a7.488 7.488 0 0 0-5.982 2.975m11.963 0a9 9 0 1 0-11.963 0m11.963 0A8.966 8.966 0 0 1 12 21a8.966 8.966 0 0 1-5.982-2.275M15 9.75a3 3 0 1 1-6 0 3 3 0 0 1 6 0Z" /> + </svg> + </a> + } <button type="button" name="toggle sidebar" class="relative inline-flex items-center justify-center rounded-md bg-indigo-600 p-1 text-indigo-200 hover:bg-indigo-500 hover:bg-opacity-75 hover:text-white focus:outline-none focus:ring-2 focus:ring-white focus:ring-offset-2 focus:ring-offset-indigo-600" aria-controls="mobile-menu" aria-expanded="false" onClick={(e) => { setOpen(!open) |