mirror of
https://github.com/Azure/cosmos-explorer.git
synced 2026-01-08 20:17:03 +00:00
Compare commits
1 Commits
master
...
users/saks
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8eade71456 |
@@ -17,6 +17,38 @@
|
|||||||
position: fixed;
|
position: fixed;
|
||||||
top: -200px;
|
top: -200px;
|
||||||
}
|
}
|
||||||
|
body.isDarkMode .ms-Layer {
|
||||||
|
.ms-Callout-main {
|
||||||
|
background-color: @BaseHigh !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Callout-beak {
|
||||||
|
background-color: @BaseHigh !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-ContextualMenu {
|
||||||
|
background-color: @BaseHigh !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Dropdown-items {
|
||||||
|
background-color: @BaseHigh !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Dropdown-item {
|
||||||
|
background-color: @BaseHigh !important;
|
||||||
|
color: @BaseLight !important;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: @BaseMediumHigh !important;
|
||||||
|
color: @BaseLight !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-selected {
|
||||||
|
background-color: @BaseMediumHigh !important;
|
||||||
|
color: @BaseLight !important;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
html {
|
html {
|
||||||
font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
|
font-family: wf_segoe-ui_normal, "Segoe UI", "Segoe WP", Tahoma, Arial, sans-serif;
|
||||||
@@ -129,6 +161,65 @@ body {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.isDarkMode .accountSwitchContextualMenu {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
|
||||||
|
.ms-Callout-main {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-ContextualMenu-item {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Dropdown {
|
||||||
|
.ms-Dropdown-title {
|
||||||
|
background-color: @BaseDark;
|
||||||
|
color: @BaseLight;
|
||||||
|
border-color: @BaseMediumHigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Dropdown-caretDownWrapper {
|
||||||
|
color: @BaseLight;
|
||||||
|
}
|
||||||
|
|
||||||
|
&:hover .ms-Dropdown-title {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
color: @BaseLight;
|
||||||
|
border-color: @BaseMedium;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Label {
|
||||||
|
color: @BaseLight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
&.isDarkMode .ms-Dropdown-callout {
|
||||||
|
.ms-Callout-main {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Dropdown-items {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
}
|
||||||
|
|
||||||
|
.ms-Dropdown-item {
|
||||||
|
background-color: @BaseHigh;
|
||||||
|
color: @BaseLight;
|
||||||
|
|
||||||
|
&:hover {
|
||||||
|
background-color: @BaseMediumHigh;
|
||||||
|
color: @BaseLight;
|
||||||
|
}
|
||||||
|
|
||||||
|
&.is-selected {
|
||||||
|
background-color: @BaseMediumHigh;
|
||||||
|
color: @BaseLight;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.fixedleftpane {
|
.fixedleftpane {
|
||||||
background: @BaseLow;
|
background: @BaseLow;
|
||||||
height: 100vh;
|
height: 100vh;
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
import { initializeIcons } from "@fluentui/react";
|
import { initializeIcons } from "@fluentui/react";
|
||||||
import { useBoolean } from "@fluentui/react-hooks";
|
import { useBoolean } from "@fluentui/react-hooks";
|
||||||
|
import { MessageTypes } from "Contracts/MessageTypes";
|
||||||
import { AadAuthorizationFailure } from "Platform/Hosted/Components/AadAuthorizationFailure";
|
import { AadAuthorizationFailure } from "Platform/Hosted/Components/AadAuthorizationFailure";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { render } from "react-dom";
|
import { render } from "react-dom";
|
||||||
@@ -21,9 +22,33 @@ import "./Shared/appInsights";
|
|||||||
import { useAADAuth } from "./hooks/useAADAuth";
|
import { useAADAuth } from "./hooks/useAADAuth";
|
||||||
import { useConfig } from "./hooks/useConfig";
|
import { useConfig } from "./hooks/useConfig";
|
||||||
import { useTokenMetadata } from "./hooks/usePortalAccessToken";
|
import { useTokenMetadata } from "./hooks/usePortalAccessToken";
|
||||||
|
import { THEME_MODE_DARK, useThemeStore } from "./hooks/useTheme";
|
||||||
|
|
||||||
initializeIcons();
|
initializeIcons();
|
||||||
|
|
||||||
|
if (typeof window !== "undefined") {
|
||||||
|
window.addEventListener("message", (event) => {
|
||||||
|
const messageData = event.data?.data || event.data;
|
||||||
|
const messageType = messageData?.type;
|
||||||
|
|
||||||
|
if (messageType === MessageTypes.UpdateTheme) {
|
||||||
|
const themeData = messageData?.params?.theme || messageData?.theme;
|
||||||
|
if (themeData && themeData.mode !== undefined) {
|
||||||
|
const isDark = themeData.mode === THEME_MODE_DARK;
|
||||||
|
useThemeStore.setState({
|
||||||
|
isDarkMode: isDark,
|
||||||
|
themeMode: themeData.mode,
|
||||||
|
});
|
||||||
|
if (isDark) {
|
||||||
|
document.body.classList.add("isDarkMode");
|
||||||
|
} else {
|
||||||
|
document.body.classList.remove("isDarkMode");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
const App: React.FunctionComponent = () => {
|
const App: React.FunctionComponent = () => {
|
||||||
// For handling encrypted portal tokens sent via query paramter
|
// For handling encrypted portal tokens sent via query paramter
|
||||||
const params = new URLSearchParams(window.location.search);
|
const params = new URLSearchParams(window.location.search);
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
// TODO: Renable this rule for the file or turn it off everywhere
|
// TODO: Renable this rule for the file or turn it off everywhere
|
||||||
/* eslint-disable react/display-name */
|
/* eslint-disable react/display-name */
|
||||||
|
|
||||||
import { DefaultButton, IButtonStyles, IContextualMenuItem } from "@fluentui/react";
|
import { DefaultButton, IButtonStyles, IContextualMenuItem, IContextualMenuProps } from "@fluentui/react";
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import { FunctionComponent, useEffect, useState } from "react";
|
import { FunctionComponent, useEffect, useState } from "react";
|
||||||
import { StyleConstants } from "../../../Common/StyleConstants";
|
import { StyleConstants } from "../../../Common/StyleConstants";
|
||||||
@@ -92,14 +92,16 @@ export const AccountSwitcher: FunctionComponent<Props> = ({ armToken, setDatabas
|
|||||||
},
|
},
|
||||||
];
|
];
|
||||||
|
|
||||||
return (
|
const menuProps: IContextualMenuProps = {
|
||||||
<DefaultButton
|
|
||||||
text={buttonText}
|
|
||||||
menuProps={{
|
|
||||||
directionalHintFixed: true,
|
directionalHintFixed: true,
|
||||||
className: "accountSwitchContextualMenu",
|
className: "accountSwitchContextualMenu",
|
||||||
items,
|
items,
|
||||||
}}
|
};
|
||||||
|
|
||||||
|
return (
|
||||||
|
<DefaultButton
|
||||||
|
text={buttonText}
|
||||||
|
menuProps={menuProps}
|
||||||
styles={buttonStyles}
|
styles={buttonStyles}
|
||||||
className="accountSwitchButton"
|
className="accountSwitchButton"
|
||||||
id="accountSwitchButton"
|
id="accountSwitchButton"
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ export const SwitchAccount: FunctionComponent<Props> = ({
|
|||||||
}}
|
}}
|
||||||
defaultSelectedKey={selectedAccount?.name}
|
defaultSelectedKey={selectedAccount?.name}
|
||||||
placeholder={accounts && accounts.length === 0 ? "No Accounts Found" : "Select an Account"}
|
placeholder={accounts && accounts.length === 0 ? "No Accounts Found" : "Select an Account"}
|
||||||
styles={{
|
|
||||||
callout: "accountSwitchAccountDropdownMenu",
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -30,9 +30,6 @@ export const SwitchSubscription: FunctionComponent<Props> = ({
|
|||||||
}}
|
}}
|
||||||
defaultSelectedKey={selectedSubscription?.subscriptionId}
|
defaultSelectedKey={selectedSubscription?.subscriptionId}
|
||||||
placeholder={subscriptions && subscriptions.length === 0 ? "No Subscriptions Found" : "Select a Subscription"}
|
placeholder={subscriptions && subscriptions.length === 0 ? "No Subscriptions Found" : "Select a Subscription"}
|
||||||
styles={{
|
|
||||||
callout: "accountSwitchSubscriptionDropdownMenu",
|
|
||||||
}}
|
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user