diff --git a/native/navigation/tooltip.react.js b/native/navigation/tooltip.react.js --- a/native/navigation/tooltip.react.js +++ b/native/navigation/tooltip.react.js @@ -10,7 +10,6 @@ import * as React from 'react'; import { View, - StyleSheet, TouchableWithoutFeedback, Platform, TouchableOpacity, @@ -40,6 +39,7 @@ import { type InputState, InputStateContext } from '../input/input-state'; import { type DimensionsInfo } from '../redux/dimensions-updater.react'; import { useSelector } from '../redux/redux-utils'; +import { useStyles } from '../themes/colors'; import { type VerticalBounds, type LayoutCoordinates, @@ -72,6 +72,7 @@ +onPress: (entry: TooltipEntry) => void, +containerStyle?: ViewStyle, +labelStyle?: TextStyle, + +styles: typeof unboundStyles, }; type TooltipSpec = { +entries: $ReadOnlyArray>, @@ -119,6 +120,7 @@ +showActionSheetWithOptions: ShowActionSheetWithOptions, +actionSheetShown: boolean, +setActionSheetShown: (actionSheetShown: boolean) => void, + +styles: typeof unboundStyles, }; function createTooltip< @@ -131,6 +133,7 @@ class TooltipItem extends React.PureComponent> { render() { let icon; + const { styles } = this.props; if (this.props.spec.id === 'copy') { icon = ; } else if (this.props.spec.id === 'reply') { @@ -273,7 +276,7 @@ get opacityStyle() { return { - ...styles.backdrop, + ...this.props.styles.backdrop, opacity: this.backdropOpacity, }; } @@ -285,7 +288,7 @@ const bottom = fullScreenHeight - verticalBounds.y - verticalBounds.height; return { - ...styles.contentContainer, + ...this.props.styles.contentContainer, marginTop: top, marginBottom: bottom, }; @@ -379,6 +382,7 @@ showActionSheetWithOptions, actionSheetShown, setActionSheetShown, + styles, ...navAndRouteForFlow } = this.props; @@ -403,6 +407,7 @@ onPress={this.onPressEntry} containerStyle={[...tooltipContainerStyle, style]} labelStyle={tooltipSpec.labelStyle} + styles={styles} /> ); }); @@ -422,6 +427,7 @@ spec={moreSpec} onPress={moreSpec.onPress} containerStyle={tooltipContainerStyle} + styles={styles} /> ); @@ -539,6 +545,7 @@ paddingBottom: 24, }; + const { styles } = this.props; const icons = [ ); }); } -const styles = StyleSheet.create({ +const unboundStyles = { backdrop: { backgroundColor: 'black', bottom: 0, @@ -694,7 +704,7 @@ overflow: 'hidden', }, icon: { - color: '#FFFFFF', + color: 'modalForegroundLabel', }, itemContainer: { alignItems: 'center', @@ -711,11 +721,11 @@ borderBottomWidth: 1, }, itemMarginFixed: { - borderRightColor: '#404040', + borderRightColor: 'panelForegroundBorder', borderRightWidth: 1, }, items: { - backgroundColor: '#1F1F1F', + backgroundColor: 'panelBackground', borderRadius: 5, overflow: 'hidden', }, @@ -724,7 +734,7 @@ flexDirection: 'row', }, label: { - color: '#FFFFFF', + color: 'modalForegroundLabel', fontSize: 14, lineHeight: 17, textAlign: 'center', @@ -757,7 +767,7 @@ height: 10, width: 10, }, -}); +}; function tooltipHeight(numEntries: number): number { // 10 (triangle) + 37 * numEntries (entries) + numEntries - 1 (padding)