Skip to content

Commit 06a81b6

Browse files
chrisbobbegnprice
authored andcommitted
ComposeBox: Make compose-menu buttons a less shouty color
1 parent ebcbeca commit 06a81b6

File tree

1 file changed

+14
-2
lines changed

1 file changed

+14
-2
lines changed

src/compose/ComposeMenu.js

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
/* @flow strict-local */
2+
// $FlowFixMe[untyped-import]
3+
import Color from 'color';
24
import React, { useCallback, useContext, useMemo } from 'react';
35
import type { Node } from 'react';
46
import { Platform, View, Alert, Linking, Pressable } from 'react-native';
@@ -10,10 +12,11 @@ import * as logging from '../utils/logging';
1012
import { TranslationContext } from '../boot/TranslationProvider';
1113
import type { Narrow } from '../types';
1214
import { showErrorAlert } from '../utils/info';
13-
import { BRAND_COLOR, HIGHLIGHT_COLOR, createStyleSheet } from '../styles';
15+
import { createStyleSheet } from '../styles';
1416
import { IconImage, IconCamera, IconAttach, IconVideo } from '../common/Icons';
1517
import { uploadFile } from '../actions';
1618
import { androidEnsureStoragePermission } from '../lightbox/download';
19+
import { ThemeContext } from '../styles/theme';
1720
import type { SpecificIconType } from '../common/Icons';
1821

1922
type Props = $ReadOnly<{|
@@ -74,9 +77,18 @@ function MenuButton(props: MenuButtonProps) {
7477
const { onPress, IconComponent } = props;
7578
const style = useMemo(() => ({ paddingHorizontal: 12, paddingVertical: 8 }), []);
7679

80+
const themeData = useContext(ThemeContext);
81+
82+
// TODO: Use standard colors from a palette; don't do this ad-hoc stuff.
83+
const color: string = useMemo(
84+
() => Color(themeData.color).fade(0.5).toString(),
85+
[themeData.color],
86+
);
87+
const pressedColor: string = useMemo(() => Color(color).fade(0.5).toString(), [color]);
88+
7789
return (
7890
<Pressable style={style} onPress={onPress}>
79-
{({ pressed }) => <IconComponent color={pressed ? HIGHLIGHT_COLOR : BRAND_COLOR} size={24} />}
91+
{({ pressed }) => <IconComponent color={pressed ? pressedColor : color} size={24} />}
8092
</Pressable>
8193
);
8294
}

0 commit comments

Comments
 (0)