11/* @flow strict-local */
22import React , { useCallback , useContext , useMemo } from 'react' ;
33import type { Node } from 'react' ;
4- import { Platform , View , Alert , Linking } from 'react-native' ;
4+ import { Platform , View , Alert , Linking , Pressable } from 'react-native' ;
55import type { DocumentPickerResponse } from 'react-native-document-picker' ;
66import { launchCamera , launchImageLibrary } from 'react-native-image-picker' ;
77
@@ -10,7 +10,7 @@ import * as logging from '../utils/logging';
1010import { TranslationContext } from '../boot/TranslationProvider' ;
1111import type { Narrow } from '../types' ;
1212import { showErrorAlert } from '../utils/info' ;
13- import { BRAND_COLOR , createStyleSheet } from '../styles' ;
13+ import { BRAND_COLOR , HIGHLIGHT_COLOR , createStyleSheet } from '../styles' ;
1414import {
1515 IconPlusCircle ,
1616 IconLeft ,
@@ -82,9 +82,13 @@ type MenuButtonProps = $ReadOnly<{|
8282
8383function MenuButton ( props : MenuButtonProps ) {
8484 const { onPress, IconComponent } = props ;
85- const style = useMemo ( ( ) => ( { padding : 12 , marginRight : - 8 , color : BRAND_COLOR } ) , [ ] ) ;
85+ const style = useMemo ( ( ) => ( { padding : 12 , marginRight : - 8 } ) , [ ] ) ;
8686
87- return < IconComponent style = { style } size = { 24 } onPress = { onPress } /> ;
87+ return (
88+ < Pressable style = { style } onPress = { onPress } >
89+ { ( { pressed } ) => < IconComponent color = { pressed ? HIGHLIGHT_COLOR : BRAND_COLOR } size = { 24 } /> }
90+ </ Pressable >
91+ ) ;
8892}
8993
9094export default function ComposeMenu ( props : Props ) : Node {
@@ -237,7 +241,6 @@ export default function ComposeMenu(props: Props): Node {
237241 } ,
238242 expandButton : {
239243 padding : 12 ,
240- color : BRAND_COLOR ,
241244 } ,
242245 } ) ,
243246 [ ] ,
@@ -265,9 +268,17 @@ export default function ComposeMenu(props: Props): Node {
265268 </ View >
266269 </ AnimatedComponent >
267270 { ! expanded && (
268- < IconPlusCircle style = { styles . expandButton } size = { 24 } onPress = { onExpandContract } />
271+ < Pressable style = { styles . expandButton } onPress = { onExpandContract } >
272+ { ( { pressed } ) => (
273+ < IconPlusCircle color = { pressed ? HIGHLIGHT_COLOR : BRAND_COLOR } size = { 24 } />
274+ ) }
275+ </ Pressable >
276+ ) }
277+ { expanded && (
278+ < Pressable style = { styles . expandButton } onPress = { onExpandContract } >
279+ { ( { pressed } ) => < IconLeft color = { pressed ? HIGHLIGHT_COLOR : BRAND_COLOR } size = { 24 } /> }
280+ </ Pressable >
269281 ) }
270- { expanded && < IconLeft style = { styles . expandButton } size = { 24 } onPress = { onExpandContract } /> }
271282 </ View >
272283 ) ;
273284}
0 commit comments