mirror of
https://github.com/urosran/cally.git
synced 2026-10-25 23:37:54 +00:00
fixes, deleteFamily function, household signup
This commit is contained in:
@@ -32,8 +32,11 @@ const AddFeedback = ({
|
||||
const descriptionRef = useRef<TextFieldRef>(null);
|
||||
const titleRef = useRef<TextFieldRef>(null);
|
||||
|
||||
const isTitleValid = feedbackTitle.trim().length >= 3;
|
||||
|
||||
useEffect(() => {
|
||||
setFeedback("");
|
||||
setFeedbackTitle("");
|
||||
}, [addFeedbackProps.isVisible]);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -46,9 +49,8 @@ const AddFeedback = ({
|
||||
|
||||
useEffect(() => {
|
||||
if (Platform.OS === "ios") KeyboardManager.setEnableAutoToolbar(false);
|
||||
|
||||
setFeedbackTitle("");
|
||||
setFeedback("");
|
||||
setFeedbackTitle('');
|
||||
setFeedback('');
|
||||
}, []);
|
||||
|
||||
return (
|
||||
@@ -76,16 +78,17 @@ const AddFeedback = ({
|
||||
<Button
|
||||
color="#05a8b6"
|
||||
label="Save"
|
||||
style={styles.topBtn}
|
||||
style={[styles.topBtn, !isTitleValid && styles.disabledBtn]}
|
||||
disabled={!isTitleValid}
|
||||
onPress={() => {
|
||||
addFeedback({
|
||||
id: 99,
|
||||
|
||||
title: feedbackTitle.trimEnd().trimStart(),
|
||||
|
||||
text: feedback.trimEnd().trimStart(),
|
||||
});
|
||||
addFeedbackProps.setIsVisible(false);
|
||||
if (isTitleValid) {
|
||||
addFeedback({
|
||||
id: 99,
|
||||
title: feedbackTitle.trim(),
|
||||
text: feedback.trim(),
|
||||
});
|
||||
addFeedbackProps.setIsVisible(false);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
@@ -142,6 +145,9 @@ const styles = StyleSheet.create({
|
||||
backgroundColor: "white",
|
||||
color: "#05a8b6",
|
||||
},
|
||||
disabledBtn: {
|
||||
opacity: 0.2,
|
||||
},
|
||||
title: {
|
||||
fontSize: 22,
|
||||
fontFamily: "Manrope_500Medium",
|
||||
@@ -153,4 +159,4 @@ const styles = StyleSheet.create({
|
||||
},
|
||||
});
|
||||
|
||||
export default AddFeedback;
|
||||
export default AddFeedback;
|
||||
Reference in New Issue
Block a user