From a6b49cf9868af17dce9ab1555802f8096b4600cf Mon Sep 17 00:00:00 2001 From: YingFeiZhou Date: Mon, 3 Mar 2025 16:31:34 +0800 Subject: [PATCH] feat: Pass to render a custom clear button --- src/components/textField/ClearButton.tsx | 31 +++++++++++++++--------- src/components/textField/index.tsx | 3 +++ src/components/textField/types.ts | 7 ++++++ 3 files changed, 30 insertions(+), 11 deletions(-) diff --git a/src/components/textField/ClearButton.tsx b/src/components/textField/ClearButton.tsx index 3fd8f03a01..5e3c772c6c 100644 --- a/src/components/textField/ClearButton.tsx +++ b/src/components/textField/ClearButton.tsx @@ -17,7 +17,7 @@ const TIMING_CONFIG = { easing: Easing.bezier(0.33, 1, 0.68, 1) }; -const ClearButton = ({testID, onClear, onChangeText, clearButtonStyle}: ClearButtonProps) => { +const ClearButton = ({testID, onClear, onChangeText, clearButtonStyle,ClearButtonContentComponent}: ClearButtonProps) => { const {hasValue} = useContext(FieldContext); const animatedValue = useSharedValue(hasValue ? VISIBLE_POSITION : NON_VISIBLE_POSITION); const animatedOpacity = useSharedValue(hasValue ? 1 : 0); @@ -49,16 +49,25 @@ const ClearButton = ({testID, onClear, onChangeText, clearButtonStyle}: ClearBut return ( -