mirror of
https://github.com/urosran/cally.git
synced 2025-07-17 02:25:10 +00:00
fixes, deleteFamily function, household signup
This commit is contained in:
@ -13,8 +13,8 @@ interface IAddBrainDumpProps {
|
||||
}
|
||||
|
||||
const AddBrainDump = ({
|
||||
addBrainDumpProps,
|
||||
}: {
|
||||
addBrainDumpProps,
|
||||
}: {
|
||||
addBrainDumpProps: IAddBrainDumpProps;
|
||||
}) => {
|
||||
const {addBrainDump} = useBrainDumpContext();
|
||||
@ -22,11 +22,11 @@ const AddBrainDump = ({
|
||||
const [dumpDesc, setDumpDesc] = useState<string>("");
|
||||
const {width} = Dimensions.get("screen");
|
||||
|
||||
|
||||
// Refs for the two TextFields
|
||||
const descriptionRef = useRef<TextFieldRef>(null);
|
||||
const titleRef = useRef<TextFieldRef>(null);
|
||||
|
||||
const isTitleValid = dumpTitle.trim().length >= 3;
|
||||
|
||||
useEffect(() => {
|
||||
setDumpDesc("");
|
||||
setDumpTitle("");
|
||||
@ -40,9 +40,9 @@ const AddBrainDump = ({
|
||||
}
|
||||
}, [addBrainDumpProps.isVisible]);
|
||||
|
||||
useEffect(() => {
|
||||
if (Platform.OS === "ios") KeyboardManager.setEnableAutoToolbar(false);
|
||||
}, []);
|
||||
useEffect(() => {
|
||||
if (Platform.OS === "ios") KeyboardManager.setEnableAutoToolbar(false);
|
||||
}, []);
|
||||
|
||||
return (
|
||||
<Dialog
|
||||
@ -69,18 +69,17 @@ const AddBrainDump = ({
|
||||
<Button
|
||||
color="#05a8b6"
|
||||
label="Save"
|
||||
style={styles.topBtn}
|
||||
style={[styles.topBtn, !isTitleValid && styles.disabledBtn]}
|
||||
disabled={!isTitleValid}
|
||||
onPress={() => {
|
||||
addBrainDump({
|
||||
|
||||
id: '99',
|
||||
|
||||
title: dumpTitle.trimEnd().trimStart(),
|
||||
|
||||
description: dumpDesc.trimEnd().trimStart(),
|
||||
|
||||
});
|
||||
addBrainDumpProps.setIsVisible(false);
|
||||
if (isTitleValid) {
|
||||
addBrainDump({
|
||||
id: '99',
|
||||
title: dumpTitle.trim(),
|
||||
description: dumpDesc.trim(),
|
||||
});
|
||||
addBrainDumpProps.setIsVisible(false);
|
||||
}
|
||||
}}
|
||||
/>
|
||||
</View>
|
||||
@ -94,11 +93,10 @@ const AddBrainDump = ({
|
||||
setDumpTitle(text);
|
||||
}}
|
||||
onSubmitEditing={() => {
|
||||
// Move focus to the description field
|
||||
descriptionRef.current?.focus();
|
||||
}}
|
||||
style={styles.title}
|
||||
blurOnSubmit={false} // Keep the keyboard open when moving focus
|
||||
blurOnSubmit={false}
|
||||
returnKeyType="next"
|
||||
/>
|
||||
<View height={2} backgroundColor="#b3b3b3" width={"100%"} marginB-20/>
|
||||
@ -125,28 +123,31 @@ const AddBrainDump = ({
|
||||
};
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
dialogContainer: {
|
||||
borderTopRightRadius: 15,
|
||||
borderTopLeftRadius: 15,
|
||||
backgroundColor: "white",
|
||||
padding: 0,
|
||||
paddingTop: 3,
|
||||
margin: 0,
|
||||
},
|
||||
topBtns: {},
|
||||
topBtn: {
|
||||
backgroundColor: "white",
|
||||
color: "#05a8b6",
|
||||
},
|
||||
title: {
|
||||
fontSize: 22,
|
||||
fontFamily: "Manrope_500Medium",
|
||||
},
|
||||
description: {
|
||||
fontFamily: "Manrope_400Regular",
|
||||
fontSize: 14,
|
||||
textAlignVertical: "top",
|
||||
},
|
||||
dialogContainer: {
|
||||
borderTopRightRadius: 15,
|
||||
borderTopLeftRadius: 15,
|
||||
backgroundColor: "white",
|
||||
padding: 0,
|
||||
paddingTop: 3,
|
||||
margin: 0,
|
||||
},
|
||||
topBtns: {},
|
||||
topBtn: {
|
||||
backgroundColor: "white",
|
||||
color: "#05a8b6",
|
||||
},
|
||||
disabledBtn: {
|
||||
opacity: 0.2,
|
||||
},
|
||||
title: {
|
||||
fontSize: 22,
|
||||
fontFamily: "Manrope_500Medium",
|
||||
},
|
||||
description: {
|
||||
fontFamily: "Manrope_400Regular",
|
||||
fontSize: 14,
|
||||
textAlignVertical: "top",
|
||||
},
|
||||
});
|
||||
|
||||
export default AddBrainDump;
|
||||
export default AddBrainDump;
|
Reference in New Issue
Block a user