({
parentState,
error,
colors,
activeColor,
underlineColorCustom,
hasActiveOutline,
style,
theme: themeOverrides,
}: UnderlineProps)
| 21 | }; |
| 22 | |
| 23 | export const Underline = ({ |
| 24 | parentState, |
| 25 | error, |
| 26 | colors, |
| 27 | activeColor, |
| 28 | underlineColorCustom, |
| 29 | hasActiveOutline, |
| 30 | style, |
| 31 | theme: themeOverrides, |
| 32 | }: UnderlineProps) => { |
| 33 | const { isV3 } = useInternalTheme(themeOverrides); |
| 34 | |
| 35 | let backgroundColor = parentState.focused |
| 36 | ? activeColor |
| 37 | : underlineColorCustom; |
| 38 | |
| 39 | if (error) backgroundColor = colors?.error; |
| 40 | |
| 41 | const activeScale = isV3 ? 2 : 1; |
| 42 | |
| 43 | return ( |
| 44 | <Animated.View |
| 45 | testID="text-input-underline" |
| 46 | style={[ |
| 47 | styles.underline, |
| 48 | isV3 && styles.md3Underline, |
| 49 | { |
| 50 | backgroundColor, |
| 51 | // Underlines is thinner when input is not focused |
| 52 | transform: [ |
| 53 | { |
| 54 | scaleY: (isV3 ? hasActiveOutline : parentState.focused) |
| 55 | ? activeScale |
| 56 | : 0.5, |
| 57 | }, |
| 58 | ], |
| 59 | }, |
| 60 | style, |
| 61 | ]} |
| 62 | /> |
| 63 | ); |
| 64 | }; |
| 65 | |
| 66 | const styles = StyleSheet.create({ |
| 67 | underline: { |
nothing calls this directly
no test coverage detected
searching dependent graphs…