jscheffl commented on code in PR #54305:
URL: https://github.com/apache/airflow/pull/54305#discussion_r2265368651
##########
airflow-core/src/airflow/ui/src/layouts/Nav/PluginMenuItem.tsx:
##########
@@ -23,20 +23,30 @@ import { RiArchiveStackLine } from "react-icons/ri";
import { Link as RouterLink } from "react-router-dom";
import type { ExternalViewResponse } from "openapi/requests/types.gen";
+import { useColorMode } from "src/context/colorMode";
import type { NavItemResponse } from "src/utils/types";
import { NavButton } from "./NavButton";
type Props = { readonly topLevel?: boolean } & NavItemResponse;
-export const PluginMenuItem = ({ icon, name, topLevel = false, url_route:
urlRoute, ...rest }: Props) => {
+export const PluginMenuItem = ({
+ icon,
+ icon_dark_mode: iconDarkMode,
+ name,
+ topLevel = false,
+ url_route: urlRoute,
+ ...rest
+}: Props) => {
// Determine if this is an external view or react app based on the presence
of href
+ const { colorMode } = useColorMode();
const isExternalView = "href" in rest;
const href = isExternalView ? (rest as ExternalViewResponse).href :
undefined;
+ const someIcon = colorMode === "dark" && typeof iconDarkMode === "string" ?
iconDarkMode : icon;
Review Comment:
I am not really happy with the name but `displayIcon` is a bit better than
`someIcon`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]