Skip to content

Commit e771165

Browse files
committed
fix(mobile): map native menu icon colors explicitly
Adopted from upstream `pingdotgg/t3code` `f9137a0c8`, the follow-up to #8843. Applies line-for-line identical to upstream.
1 parent 22ada7e commit e771165

1 file changed

Lines changed: 27 additions & 18 deletions

File tree

‎apps/mobile/src/components/ControlPill.tsx‎

Lines changed: 27 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -19,24 +19,33 @@ import { AndroidAnchoredMenu } from "./AndroidAnchoredMenu";
1919
import { SymbolView } from "./AppSymbol";
2020
import { AppText as Text } from "./AppText";
2121

22-
const ThemedMenuView = withUniwind(function NativeMenuView({
23-
iconColor,
24-
destructiveIconColor,
25-
...props
26-
}: ComponentProps<typeof MenuView> & {
27-
readonly iconColor?: ColorValue;
28-
readonly destructiveIconColor?: ColorValue;
29-
}) {
30-
const actions = useMemo(
31-
() =>
32-
withMenuActionIconColors(props.actions, {
33-
icon: iconColor,
34-
destructiveIcon: destructiveIconColor,
35-
}),
36-
[props.actions, iconColor, destructiveIconColor],
37-
);
38-
return <MenuView {...props} actions={actions} />;
39-
});
22+
const ThemedMenuView = withUniwind(
23+
function NativeMenuView({
24+
iconColor,
25+
destructiveIconColor,
26+
...props
27+
}: ComponentProps<typeof MenuView> & {
28+
readonly iconColor?: ColorValue;
29+
readonly destructiveIconColor?: ColorValue;
30+
}) {
31+
const actions = useMemo(
32+
() =>
33+
withMenuActionIconColors(props.actions, {
34+
icon: iconColor,
35+
destructiveIcon: destructiveIconColor,
36+
}),
37+
[props.actions, iconColor, destructiveIconColor],
38+
);
39+
return <MenuView {...props} actions={actions} />;
40+
},
41+
{
42+
iconColor: { fromClassName: "iconColorClassName", styleProperty: "accentColor" },
43+
destructiveIconColor: {
44+
fromClassName: "destructiveIconColorClassName",
45+
styleProperty: "accentColor",
46+
},
47+
},
48+
);
4049

4150
export function ControlPill(props: {
4251
readonly icon?: ComponentProps<typeof SymbolView>["name"];

0 commit comments

Comments
 (0)