frontend: pass the numeric value to the ScaleSlider formatter
Pedro Lucas Porcellis porcellis@eletrotupi.com · 12 days ago
95635d298d63fdc438febf91306035d74703c16b Browse filesParents
dccd3efChanged files
1
Additions
+2
Deletions
-3
frontend/components/ui/ScaleSlider.tsx
1 -
import React, { useState } from 'react';
1 +
import React from 'react';
2 2
import {
3 3
View,
4 4
StyleSheet,
5 5
ViewStyle,
6 6
} from 'react-native';
41 41
showMax,
42 42
variant = 'compact',
43 43
style,
44 44
}) => {
45 45
const textColor = useThemeColor({}, 'text');
46 -
const secondaryColor = useThemeColor({}, 'textSecondary');
47 46
const tintColor = useThemeColor({}, 'tint');
48 47
const trackingColor = useThemeColor({}, 'sliderTracking');
49 48
const sliderLabelsColor = useThemeColor({}, 'sliderLabels');
50 49
51 50
const isRich = variant === 'rich';
73 72
74 73
<Text style={[
75 74
isRich ? styles.valueRich : styles.valueCompact,
76 75
{ color: textColor },
77 76
]}>
78 -
{(onValueFormat ? onValueFormat(valueDisplay) : valueDisplay)}
77 +
{(onValueFormat ? onValueFormat(value) : valueDisplay)}
79 78
</Text>
80 79
</View>
81 80
82 81
{/* XXX: Rich variant needs some extra margin to account for icons */}
83 82
<View style={{ marginRight: isRich ? -10 : -15, marginLeft: isRich ? -10 : -15 }}>
180 179
rangeLabel: {
181 180
...Theme.typography.labelXs,
182 181
fontWeight: 500,
183 182
},
184 183
});