From 944caafe76a0bd64695ec7f8e077faef516a6166 Mon Sep 17 00:00:00 2001 From: Manav Rathi Date: Thu, 16 Jan 2025 08:07:33 +0530 Subject: [PATCH] Fix --- web/packages/base/components/utils/theme.ts | 7 +------ .../new/photos/components/SearchBar.tsx | 21 +++++++++---------- 2 files changed, 11 insertions(+), 17 deletions(-) diff --git a/web/packages/base/components/utils/theme.ts b/web/packages/base/components/utils/theme.ts index e91466109e..6d40bce1d0 100644 --- a/web/packages/base/components/utils/theme.ts +++ b/web/packages/base/components/utils/theme.ts @@ -1,8 +1,3 @@ -// TODO(LM) -/* eslint-disable @typescript-eslint/no-unsafe-enum-comparison */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ - import type { AppName } from "@/base/app"; import type { Theme } from "@mui/material"; import { createTheme } from "@mui/material"; @@ -223,7 +218,7 @@ const _colors = { }; const getColorSchemes = (colors: ReturnType) => ({ - light: false, + // light: false, dark: { palette: { primary: { diff --git a/web/packages/new/photos/components/SearchBar.tsx b/web/packages/new/photos/components/SearchBar.tsx index 3d6b36d744..cf6195caa0 100644 --- a/web/packages/new/photos/components/SearchBar.tsx +++ b/web/packages/new/photos/components/SearchBar.tsx @@ -258,24 +258,23 @@ const SearchInputWrapper = styled("div")` const loadOptions = pDebounce(searchOptionsForString, 250); -const createSelectStyles = ({ - colors, - palette, -}: Theme): StylesConfig => ({ +const createSelectStyles = ( + theme: Theme, +): StylesConfig => ({ container: (style) => ({ ...style, flex: 1 }), control: (style, { isFocused }) => ({ ...style, - backgroundColor: palette.background.paper, - borderColor: isFocused ? palette.accent.main : "transparent", + backgroundColor: theme.vars.palette.background.paper, + borderColor: isFocused ? theme.vars.palette.accent.main : "transparent", boxShadow: "none", ":hover": { - borderColor: palette.accent.light, + borderColor: theme.vars.palette.accent.light, cursor: "text", }, }), input: (styles) => ({ ...styles, - color: colors.text.base, + color: theme.vars.palette.text.base, overflowX: "hidden", }), menu: (style) => ({ @@ -284,7 +283,7 @@ const createSelectStyles = ({ marginTop: "1px", // Give an opaque and elevated surface color to the menu to override the // default (transparent). - backgroundColor: palette.background.paper, + backgroundColor: theme.vars.palette.background.paper, }), option: (style, { isFocused }) => ({ ...style, @@ -295,7 +294,7 @@ const createSelectStyles = ({ }, // Elevate the focused option further. "& .option-contents": isFocused - ? { backgroundColor: palette.background.paper2 } + ? { backgroundColor: theme.vars.palette.background.paper2 } : {}, "&:last-child .MuiDivider-root": { display: "none", @@ -303,7 +302,7 @@ const createSelectStyles = ({ }), placeholder: (style) => ({ ...style, - color: colors.text.muted, + color: theme.vars.palette.text.muted, whiteSpace: "nowrap", overflowX: "hidden", }),