Skip to content

feat: add light theme #11266

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 21 commits into from
Dec 20, 2023
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
oh boy
  • Loading branch information
aslilac committed Dec 18, 2023
commit 405d0f3497e99609137fc48619975fd90ebd3a0e
4 changes: 0 additions & 4 deletions site/src/@types/mui.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@ import type { PaletteColor, PaletteColorOptions } from "@mui/material/styles";
import type { NewTheme } from "theme/experimental";

declare module "@mui/material/styles" {
interface Theme {
experimental: NewTheme;
}

interface Palette {
neutral: PaletteColor;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { useTheme } from "@mui/material/styles";
import { useTheme } from "@emotion/react";
import HelpOutline from "@mui/icons-material/HelpOutline";
import Tooltip from "@mui/material/Tooltip";
import { type FC } from "react";
Expand Down
9 changes: 6 additions & 3 deletions site/src/components/Resources/AgentLatency.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { type FC, useRef, useState } from "react";
import { useTheme } from "@emotion/react";
import { Theme } from "@mui/material/styles";
import { type Theme, useTheme } from "@emotion/react";
import type { WorkspaceAgent, DERPRegion } from "api/typesGenerated";
import {
HelpTooltipText,
Expand Down Expand Up @@ -29,7 +28,11 @@ const getDisplayLatency = (theme: Theme, agent: WorkspaceAgent) => {
};
};

export const AgentLatency: FC<{ agent: WorkspaceAgent }> = ({ agent }) => {
interface AgentLatencyProps {
agent: WorkspaceAgent;
}

export const AgentLatency: FC<AgentLatencyProps> = ({ agent }) => {
const theme = useTheme();
const anchorRef = useRef<HTMLButtonElement>(null);
const [isOpen, setIsOpen] = useState(false);
Expand Down
31 changes: 16 additions & 15 deletions site/src/pages/HealthPage/DERPRegionPage.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,19 @@
import Tooltip from "@mui/material/Tooltip";
import CodeOutlined from "@mui/icons-material/CodeOutlined";
import TagOutlined from "@mui/icons-material/TagOutlined";
import ArrowBackOutlined from "@mui/icons-material/ArrowBackOutlined";
import { useTheme } from "@emotion/react";
import { type FC } from "react";
import { Helmet } from "react-helmet-async";
import { Link, useOutletContext, useParams } from "react-router-dom";
import type {
HealthMessage,
HealthSeverity,
HealthcheckReport,
} from "api/typesGenerated";
import { getLatencyColor } from "utils/latency";
import { Alert } from "components/Alert/Alert";
import { pageTitle } from "utils/page";
import {
Header,
HeaderTitle,
Expand All @@ -8,22 +23,8 @@ import {
Logs,
HealthyDot,
} from "./Content";
import {
HealthMessage,
HealthSeverity,
HealthcheckReport,
} from "api/typesGenerated";
import CodeOutlined from "@mui/icons-material/CodeOutlined";
import TagOutlined from "@mui/icons-material/TagOutlined";
import Tooltip from "@mui/material/Tooltip";
import { useTheme } from "@mui/material/styles";
import ArrowBackOutlined from "@mui/icons-material/ArrowBackOutlined";
import { getLatencyColor } from "utils/latency";
import { Alert } from "components/Alert/Alert";
import { Helmet } from "react-helmet-async";
import { pageTitle } from "utils/page";

export const DERPRegionPage = () => {
export const DERPRegionPage: FC = () => {
const theme = useTheme();
const healthStatus = useOutletContext<HealthcheckReport>();
const params = useParams() as { regionId: string };
Expand Down
2 changes: 1 addition & 1 deletion site/src/theme/dark/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ export default {
"editor.foreground": muiTheme.palette.text.primary,
"editor.background": muiTheme.palette.background.paper,
},
} satisfies monaco.editor.IStandaloneThemeData;
} satisfies monaco.editor.IStandaloneThemeData as monaco.editor.IStandaloneThemeData;
2 changes: 1 addition & 1 deletion site/src/theme/darkBlue/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ export default {
"editor.foreground": muiTheme.palette.text.primary,
"editor.background": muiTheme.palette.background.paper,
},
} satisfies monaco.editor.IStandaloneThemeData;
} satisfies monaco.editor.IStandaloneThemeData as monaco.editor.IStandaloneThemeData;
2 changes: 1 addition & 1 deletion site/src/theme/light/monaco.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,4 +34,4 @@ export default {
"editor.foreground": muiTheme.palette.text.primary,
"editor.background": muiTheme.palette.background.paper,
},
} satisfies monaco.editor.IStandaloneThemeData;
} satisfies monaco.editor.IStandaloneThemeData as monaco.editor.IStandaloneThemeData;
2 changes: 1 addition & 1 deletion site/src/utils/latency.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Theme } from "@mui/material/styles";
import type { Theme } from "@emotion/react";

export const getLatencyColor = (theme: Theme, latency?: number) => {
if (!latency) {
Expand Down