Skip to content

Commit

Permalink
[Feature] Rebrand sample app with Contoso branding (#486)
Browse files Browse the repository at this point in the history
Co-authored-by: Ian Seabock (Centific Technologies Inc) <[email protected]>
  • Loading branch information
iseabock and Ian Seabock (Centific Technologies Inc) committed Jan 9, 2024
1 parent 9ba81d3 commit 88eaaf3
Show file tree
Hide file tree
Showing 9 changed files with 173 additions and 173 deletions.
25 changes: 25 additions & 0 deletions frontend/src/assets/Contoso.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
180 changes: 90 additions & 90 deletions frontend/src/pages/chat/Chat.tsx

Large diffs are not rendered by default.

83 changes: 28 additions & 55 deletions frontend/src/pages/layout/Layout.tsx
Original file line number Diff line number Diff line change
@@ -1,38 +1,13 @@
import { Outlet, Link } from "react-router-dom";
import styles from "./Layout.module.css";
import Azure from "../../assets/Azure.svg";
import Contoso from "../../assets/Contoso.svg";
import { CopyRegular, ShareRegular } from "@fluentui/react-icons";
import { CommandBarButton, Dialog, Stack, TextField, ICommandBarStyles, IButtonStyles, DefaultButton } from "@fluentui/react";
import { Dialog, Stack, TextField, ICommandBarStyles, IButtonStyles } from "@fluentui/react";
import { useContext, useEffect, useState } from "react";
import { HistoryButton, ShareButton } from "../../components/common/Button";
import { AppStateContext } from "../../state/AppProvider";
import { CosmosDBStatus } from "../../api";

const shareButtonStyles: ICommandBarStyles & IButtonStyles = {
root: {
width: 86,
height: 32,
borderRadius: 4,
background: 'radial-gradient(109.81% 107.82% at 100.1% 90.19%, #0F6CBD 33.63%, #2D87C3 70.31%, #8DDDD8 100%)',
// position: 'absolute',
// right: 20,
padding: '5px 12px',
marginRight: '20px'
},
icon: {
color: '#FFFFFF',
},
rootHovered: {
background: 'linear-gradient(135deg, #0F6CBD 0%, #2D87C3 51.04%, #8DDDD8 100%)',
},
label: {
fontWeight: 600,
fontSize: 14,
lineHeight: '20px',
color: '#FFFFFF',
},
};

const Layout = () => {
const [isSharePanelOpen, setIsSharePanelOpen] = useState<boolean>(false);
const [copyClicked, setCopyClicked] = useState<boolean>(false);
Expand Down Expand Up @@ -64,64 +39,62 @@ const Layout = () => {
}
}, [copyClicked]);

useEffect(() => {}, [appStateContext?.state.isCosmosDBAvailable.status]);
useEffect(() => { }, [appStateContext?.state.isCosmosDBAvailable.status]);

return (
<div className={styles.layout}>
<header className={styles.header} role={"banner"}>
<Stack horizontal verticalAlign="center" horizontalAlign="space-between"
// className={styles.headerContainer}
>
<Stack horizontal verticalAlign="center" horizontalAlign="space-between">
<Stack horizontal verticalAlign="center">
<img
src={Azure}
src={Contoso}
className={styles.headerIcon}
aria-hidden="true"
/>
<Link to="/" className={styles.headerTitleContainer}>
<h1 className={styles.headerTitle}>Azure AI</h1>
<h1 className={styles.headerTitle}>Contoso</h1>
</Link>
</Stack>
<Stack horizontal tokens={{ childrenGap: 4 }}>
{(appStateContext?.state.isCosmosDBAvailable?.status !== CosmosDBStatus.NotConfigured) &&
<HistoryButton onClick={handleHistoryClick} text={appStateContext?.state?.isChatHistoryOpen ? "Hide chat history" : "Show chat history"}/>
}
<ShareButton onClick={handleShareClick} />
{(appStateContext?.state.isCosmosDBAvailable?.status !== CosmosDBStatus.NotConfigured) &&
<HistoryButton onClick={handleHistoryClick} text={appStateContext?.state?.isChatHistoryOpen ? "Hide chat history" : "Show chat history"} />
}
<ShareButton onClick={handleShareClick} />
</Stack>

</Stack>
</header>
<Outlet />
<Dialog
<Dialog
onDismiss={handleSharePanelDismiss}
hidden={!isSharePanelOpen}
styles={{

main: [{
selectors: {
['@media (min-width: 480px)']: {
maxWidth: '600px',
background: "#FFFFFF",
boxShadow: "0px 14px 28.8px rgba(0, 0, 0, 0.24), 0px 0px 8px rgba(0, 0, 0, 0.2)",
borderRadius: "8px",
maxHeight: '200px',
minHeight: '100px',
}
['@media (min-width: 480px)']: {
maxWidth: '600px',
background: "#FFFFFF",
boxShadow: "0px 14px 28.8px rgba(0, 0, 0, 0.24), 0px 0px 8px rgba(0, 0, 0, 0.2)",
borderRadius: "8px",
maxHeight: '200px',
minHeight: '100px',
}
}
}]
}]
}}
dialogContentProps={{
title: "Share the web app",
showCloseButton: true
}}
>
<Stack horizontal verticalAlign="center" style={{gap: "8px"}}>
<TextField className={styles.urlTextBox} defaultValue={window.location.href} readOnly/>
<div
className={styles.copyButtonContainer}
role="button"
tabIndex={0}
aria-label="Copy"
<Stack horizontal verticalAlign="center" style={{ gap: "8px" }}>
<TextField className={styles.urlTextBox} defaultValue={window.location.href} readOnly />
<div
className={styles.copyButtonContainer}
role="button"
tabIndex={0}
aria-label="Copy"
onClick={handleCopyClick}
onKeyDown={e => e.key === "Enter" || e.key === " " ? handleCopyClick() : null}
>
Expand Down
23 changes: 0 additions & 23 deletions static/assets/Azure-30d5e7c0.svg

This file was deleted.

25 changes: 25 additions & 0 deletions static/assets/Contoso-ff70ad88.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 0 additions & 1 deletion static/assets/index-5453444a.js.map

This file was deleted.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions static/assets/index-67c84355.js.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions static/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
<meta charset="UTF-8" />
<link rel="icon" type="image/x-icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Azure AI</title>
<script type="module" crossorigin src="/assets/index-5453444a.js"></script>
<title>Contoso</title>
<script type="module" crossorigin src="/assets/index-67c84355.js"></script>
<link rel="stylesheet" href="/assets/index-9557690e.css">
</head>
<body>
Expand Down

0 comments on commit 88eaaf3

Please sign in to comment.