frontend: type the section header font helper and compare strictly
Pedro Lucas Porcellis porcellis@eletrotupi.com · 12 days ago
32b1e688c7e7c65b735c7e23ba3c4aeb89c33a3d Browse filesParents
ed34b04Changed files
1
Additions
+4
Deletions
-3
frontend/components/ui/Sections.tsx
1 1
import React from 'react';
2 2
import {
3 3
View,
4 4
StyleSheet,
5 5
Pressable,
6 6
ViewStyle,
7 +
TextStyle,
7 8
} from 'react-native';
8 9
import { Text } from '@/components/ui/Text'
9 10
import { Row, Between } from '@/components/ui/LayoutHelpers';
10 11
11 -
import { Colors, Typography, Spacing, BorderRadius } from '@/constants/theme';
12 +
import { Colors, Typography, Spacing } from '@/constants/theme';
12 13
import { useThemeColor } from '@/hooks/use-theme-color';
13 14
14 15
interface SectionProps {
15 16
children: React.ReactNode;
16 17
style?: ViewStyle;
59 60
default:
60 61
return textColor;
61 62
}
62 63
};
63 64
64 -
const getFont = () => {
65 +
const getFont = (): TextStyle => {
65 66
switch (variant) {
66 67
case 'subtle':
67 68
return {
68 69
fontSize: 11,
69 70
fontWeight: '600',
79 80
}
80 81
}
81 82
82 83
const styles = StyleSheet.create({
83 84
headerContainer: {
84 -
marginBottom: variant == 'subtle' ? 10 : (Spacing.cardGap * 2),
85 +
marginBottom: variant === 'subtle' ? 10 : (Spacing.cardGap * 2),
85 86
},
86 87
title: {
87 88
color: getTextColor(),
88 89
...getFont(),
89 90
},
139 140
)}
140 141
</View>
141 142
);
142 143
};
143 144