import { CommandButton, FontIcon, FontWeights, ITextProps, Separator, Stack, Text } from "@fluentui/react"; import * as React from "react"; export class GalleryHeaderComponent extends React.Component { private static readonly azureText = "Microsoft Azure"; private static readonly cosmosdbText = "Cosmos DB"; private static readonly galleryText = "Gallery"; private static readonly loginText = "Sign In"; private static readonly openPortal = () => window.open("https://portal.azure.com", "_blank"); private static readonly openDataExplorer = () => (window.location.href = new URL("./", window.location.href).href); private static readonly headerItemStyle: React.CSSProperties = { color: "white", }; private static readonly mainHeaderTextProps: ITextProps = { style: GalleryHeaderComponent.headerItemStyle, variant: "mediumPlus", styles: { root: { fontWeight: FontWeights.semibold, }, }, }; private static readonly headerItemTextProps: ITextProps = { style: GalleryHeaderComponent.headerItemStyle }; private renderHeaderItem = (text: string, onClick: () => void, textProps: ITextProps): JSX.Element => { return ( {text} ); }; public render(): JSX.Element { return ( {this.renderHeaderItem( GalleryHeaderComponent.azureText, GalleryHeaderComponent.openPortal, GalleryHeaderComponent.mainHeaderTextProps )} {this.renderHeaderItem( GalleryHeaderComponent.cosmosdbText, GalleryHeaderComponent.openDataExplorer, GalleryHeaderComponent.headerItemTextProps )} {this.renderHeaderItem( GalleryHeaderComponent.galleryText, () => "", GalleryHeaderComponent.headerItemTextProps )} <> {this.renderHeaderItem( GalleryHeaderComponent.loginText, GalleryHeaderComponent.openDataExplorer, GalleryHeaderComponent.headerItemTextProps )} ); } }