-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Expand file tree
/
Copy pathChartNavigationButton.styles.tsx
More file actions
37 lines (35 loc) · 934 Bytes
/
ChartNavigationButton.styles.tsx
File metadata and controls
37 lines (35 loc) · 934 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
import type { Theme } from '@metamask/design-tokens';
import { StyleSheet, TextStyle } from 'react-native';
const styleSheet = (params: {
theme: Theme;
vars: {
selected: boolean;
selectedColor?: string;
};
}) => {
const {
theme,
vars: { selected, selectedColor },
} = params;
const { colors } = theme;
const finalBackgroundColor = selected
? (selectedColor ?? colors.background.muted)
: 'transparent';
/** Matches {@link TimeRangeSelector} segment Pressables: `py-1`, `px-4`, `rounded-lg`, `flex-1`, `bg-muted` when selected. */
return StyleSheet.create({
button: {
flex: 1,
minWidth: 0,
alignItems: 'center',
justifyContent: 'center',
backgroundColor: finalBackgroundColor,
borderRadius: 8,
paddingVertical: 4,
paddingHorizontal: 16,
},
label: {
textAlign: 'center',
} as TextStyle,
});
};
export default styleSheet;