Live video on the AT Protocol
79
fork

Configure Feed

Select the types of activity you want to include in your feed.

Update checkbox component to be a tad more compact

+23 -21
+23 -21
js/components/src/components/ui/checkbox.tsx
··· 1 1 import { Check } from "lucide-react-native"; 2 2 import { forwardRef } from "react"; 3 3 import { StyleSheet, TouchableOpacity, View } from "react-native"; 4 - import { useTheme } from "../../lib/theme/theme"; 4 + import { Theme, useTheme } from "../../lib/theme/theme"; 5 5 import { Text } from "./text"; 6 6 7 7 export interface CheckboxProps { ··· 60 60 </View> 61 61 {(label || description) && ( 62 62 <View style={styles.content}> 63 - {label && <Text style={styles.label}>{label}</Text>} 63 + {label && ( 64 + <Text 65 + size={size === "sm" ? "sm" : size === "lg" ? "lg" : "base"} 66 + color={disabled ? "muted" : "default"} 67 + leading="loose" 68 + > 69 + {label} 70 + </Text> 71 + )} 64 72 {description && ( 65 - <Text style={styles.description}>{description}</Text> 73 + <Text 74 + size={size === "sm" ? "xs" : size === "lg" ? "base" : "sm"} 75 + color={disabled ? "muted" : "muted"} 76 + style={{ marginTop: theme.spacing[1] }} 77 + > 78 + {description} 79 + </Text> 66 80 )} 67 81 </View> 68 82 )} ··· 74 88 Checkbox.displayName = "Checkbox"; 75 89 76 90 function createStyles( 77 - theme: any, 91 + theme: Theme, 78 92 size: string, 79 93 disabled: boolean, 80 94 checked: boolean, ··· 90 104 checkboxSize: 20, 91 105 borderRadius: 4, 92 106 padding: theme.spacing[1], 93 - gap: theme.spacing[2], 107 + gap: theme.spacing[1], 94 108 }, 95 109 lg: { 96 110 checkboxSize: 24, 97 111 borderRadius: 6, 98 - padding: theme.spacing[2], 99 - gap: theme.spacing[3], 112 + padding: theme.spacing[1], 113 + gap: theme.spacing[2], 100 114 }, 101 115 }; 102 116 ··· 116 130 ? theme.colors.border 117 131 : checked 118 132 ? theme.colors.primary 119 - : theme.colors.border, 133 + : theme.colors.textMuted, 120 134 borderRadius: currentSize.borderRadius, 121 135 backgroundColor: disabled 122 136 ? theme.colors.muted ··· 128 142 }, 129 143 content: { 130 144 flex: 1, 131 - paddingTop: currentSize.padding * 0.5, 145 + paddingTop: currentSize.padding * 0.25, 132 146 paddingLeft: theme.spacing[2], 133 - }, 134 - label: { 135 - fontSize: size === "sm" ? 14 : size === "lg" ? 18 : 16, 136 - fontWeight: "500", 137 - color: disabled ? theme.colors.textDisabled : theme.colors.text, 138 - lineHeight: size === "sm" ? 18 : size === "lg" ? 22 : 20, 139 - }, 140 - description: { 141 - fontSize: size === "sm" ? 12 : size === "lg" ? 16 : 14, 142 - color: disabled ? theme.colors.textDisabled : theme.colors.textMuted, 143 - marginTop: theme.spacing[1], 144 - lineHeight: size === "sm" ? 16 : size === "lg" ? 20 : 18, 145 147 }, 146 148 }); 147 149 }