continue generating flow, add backend connection on main tabs
This commit is contained in:
@@ -45,6 +45,18 @@ export default ({ navigation }) => {
|
||||
value: "",
|
||||
type: "string",
|
||||
},
|
||||
{
|
||||
title: "Notifications",
|
||||
key: "notifications",
|
||||
value: !!currentUserData?.notifications,
|
||||
type: "boolean",
|
||||
},
|
||||
{
|
||||
title: "Langue",
|
||||
key: "language",
|
||||
value: currentUserData?.language || "",
|
||||
type: "string",
|
||||
},
|
||||
];
|
||||
|
||||
const destructiveSettingsList = [
|
||||
@@ -125,7 +137,11 @@ export default ({ navigation }) => {
|
||||
}
|
||||
};
|
||||
|
||||
if (!value) {
|
||||
// Validate input except for booleans where false is allowed
|
||||
const isInvalidString =
|
||||
typeof value === "string" && value.trim().length === 0;
|
||||
const isNullish = value === null || value === undefined;
|
||||
if (isNullish || isInvalidString) {
|
||||
throw new Error("Vérifiez les informations saisies");
|
||||
}
|
||||
|
||||
@@ -269,6 +285,12 @@ export default ({ navigation }) => {
|
||||
);
|
||||
})}
|
||||
|
||||
<ItemRowList
|
||||
title={"Gérer mon abonnement"}
|
||||
action={() => {}}
|
||||
containerStyle={{}}
|
||||
/>
|
||||
|
||||
{destructiveSettingsList.map((setting, index) => (
|
||||
<ItemRowList key={index} {...setting} containerStyle={{}} />
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user