UI优化
This commit is contained in:
@@ -49,6 +49,8 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
useEffect(() => {
|
||||
if (visible) {
|
||||
setValue(initialValue);
|
||||
const valid = initialValue.length >= 2 && initialValue.length <= maxLength;
|
||||
setIsValid(valid);
|
||||
}
|
||||
}, [visible, initialValue]);
|
||||
|
||||
@@ -70,7 +72,6 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
||||
onSave(value);
|
||||
};
|
||||
|
||||
@@ -85,7 +86,7 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
|
||||
return (
|
||||
<View className="edit_modal_overlay">
|
||||
<View className="edit_modal_container" style={{ paddingBottom: isKeyboardVisible ? (type === 'nickname' ? `${keyboardHeight + 60}px` : `${keyboardHeight }px`) : undefined }}>
|
||||
<View className="edit_modal_container" style={{ paddingBottom: isKeyboardVisible ? (type === 'nickname' ? `${keyboardHeight + 60}px` : `${keyboardHeight}px`) : undefined }}>
|
||||
{/* 标题栏 */}
|
||||
<View className="modal_header">
|
||||
<Text className="modal_title">{title}</Text>
|
||||
@@ -144,7 +145,7 @@ const EditModal: React.FC<EditModalProps> = ({
|
||||
|
||||
{/* 底部按钮 */}
|
||||
<View className="modal_footer">
|
||||
<View className="save_button" onClick={handle_save}>
|
||||
<View className={`save_button ${!isValid ? "disabled" : ""}`} onClick={handle_save}>
|
||||
<Text className="save_text">保存</Text>
|
||||
</View>
|
||||
</View>
|
||||
|
||||
Reference in New Issue
Block a user