diff --git a/apps/expo/src/components/modals/AlertModal.tsx b/apps/expo/src/components/modals/AlertModal.tsx
index 6e37933..c9c8128 100644
--- a/apps/expo/src/components/modals/AlertModal.tsx
+++ b/apps/expo/src/components/modals/AlertModal.tsx
@@ -63,7 +63,7 @@ export const AlertModal = ({
Vwidth="24"
Vheight="10"
onPress={onCancel}
- isLoading={isLoading}
+ disabled={isLoading}
/>
)}
diff --git a/apps/expo/src/components/reviewer-details/ReviewerDetailsHeader.tsx b/apps/expo/src/components/reviewer-details/ReviewerDetailsHeader.tsx
index 14bf46e..8d09d35 100644
--- a/apps/expo/src/components/reviewer-details/ReviewerDetailsHeader.tsx
+++ b/apps/expo/src/components/reviewer-details/ReviewerDetailsHeader.tsx
@@ -1,7 +1,7 @@
import { View, Text, TouchableOpacity } from "react-native";
import useGoBack from "../../hooks/useGoBack";
import EditIcon from "../../icons/EditIcon";
-import LeftArrowIcon from "../../icons/LeftArrowIcon";
+import { Feather } from "@expo/vector-icons";
interface ReviewerHeaderProps {
showEditIcon: boolean;
@@ -21,7 +21,7 @@ export const ReviewerDetailsHeader = ({
onPress={goBack}
className="flex flex-row items-center self-center"
>
-
+
Reviewer Details
diff --git a/apps/expo/src/forms/CreateTestForm/index.tsx b/apps/expo/src/forms/CreateTestForm/index.tsx
index f8accbc..9e1b7d5 100644
--- a/apps/expo/src/forms/CreateTestForm/index.tsx
+++ b/apps/expo/src/forms/CreateTestForm/index.tsx
@@ -87,7 +87,6 @@ const CreateTestForm: FC = ({
const [selectedReviewer, setSelectedReviewer] = useState(
null,
);
-
const [openAlert, setOpenAlert] = useState(false);
const [isBottomSheetOpen, setBottomSheetOpen] = useState(false);
const [errorInAIQuestion, setErrorInAIQuestion] = useState(false);
@@ -252,7 +251,11 @@ const CreateTestForm: FC = ({
}, [image, testDetails?.image]);
const handleExitScreen = () => {
- if (isDirty || questions.length > 0) {
+ if (
+ (testTitle === "Create Test" && isDirty) ||
+ (testTitle === "Edit Test" && isDirty) ||
+ questions.length > 0
+ ) {
setOpenAlert(true);
} else {
goBack();
@@ -261,7 +264,11 @@ const CreateTestForm: FC = ({
useEffect(() => {
const backAction = () => {
- if (isDirty || questions.length > 0) {
+ if (
+ (testTitle === "Create Test" && isDirty) ||
+ (testTitle === "Edit Test" && isDirty) ||
+ questions.length > 0
+ ) {
setOpenAlert(true);
} else {
goBack();
@@ -440,7 +447,13 @@ const CreateTestForm: FC = ({
screenName={testTitle}
optionIcon={}
onIconPress={() => setIsSidebarOpen(true)}
- backIcon={}
+ backIcon={
+ questions.length > 0 || testTitle === "Create Test" ? (
+
+ ) : (
+ ""
+ )
+ }
handleExit={handleExitScreen}
showDeleteIcon={testTitle === "Edit Test"}
onDeletePress={() =>
@@ -776,9 +789,9 @@ const CreateTestForm: FC = ({
= ({
onCancel={() => {
setOpenAlert(false);
}}
- onConfirm={goBack}
+ isLoading={isCreatingQuiz}
+ onConfirm={handleSubmit(submitForm)}
/>
);
diff --git a/apps/expo/src/screens/create-collection.tsx b/apps/expo/src/screens/create-collection.tsx
index 8cea352..8d345ea 100644
--- a/apps/expo/src/screens/create-collection.tsx
+++ b/apps/expo/src/screens/create-collection.tsx
@@ -251,7 +251,7 @@ export const CreateCollection = () => {
isVisible={openAlert}
alertTitle={"Are you sure?"}
alertDescription={
- "You will lose all unsaved progress if you exit this screen"
+ "You will lose all unsaved changes if you exit this screen"
}
confirmButtonText={"Yes"}
isCancelButtonVisible={true}
diff --git a/apps/expo/src/screens/create-question/index.tsx b/apps/expo/src/screens/create-question/index.tsx
index e6265d1..466a28e 100644
--- a/apps/expo/src/screens/create-question/index.tsx
+++ b/apps/expo/src/screens/create-question/index.tsx
@@ -116,6 +116,7 @@ export const CreateQuestionScreen: FC = () => {
const [choices, setChoices] = useState([]);
const [isDeleting, setIsDeleting] = useState(false);
const [isChoiceModalTouched, setIsChoiceModalTouched] = useState(false);
+ const [promptSaveModal, setPromptSaveModal] = useState(false);
const { height, width } = Dimensions.get("window");
@@ -190,6 +191,7 @@ export const CreateQuestionScreen: FC = () => {
const snapPoints = useMemo(() => ["5%", "25%", "70%"], []);
const openBottomSheet = () => {
+ handleSaveQuestion();
bottomSheetRef.current?.expand();
};
@@ -569,12 +571,7 @@ export const CreateQuestionScreen: FC = () => {
};
const handleExitScreen = () => {
- if (question?.inEdit) {
- setOpenAlert(true);
- } else {
- resetQuestionImage();
- goBack();
- }
+ setOpenAlert(true);
};
const handleDelete = () => {
@@ -979,24 +976,29 @@ export const CreateQuestionScreen: FC = () => {
-
- bottomSheetRef.current?.close()}
- />
-
+ {
+ setPromptSaveModal(false);
+ }}
+ onConfirm={handleSaveAnswer(() => {
+ setIsSaved(false);
+ setPromptSaveModal(false);
+ })}
+ />
{
onCancel={() => {
setOpenAlert(false);
}}
- onConfirm={goBack}
+ onConfirm={() => {
+ handleSaveQuestion();
+ resetQuestionImage();
+ goBack();
+ }}
/>
+
+
+ bottomSheetRef.current?.close()}
+ />
+
);
diff --git a/apps/expo/src/screens/create-reviewer/index.tsx b/apps/expo/src/screens/create-reviewer/index.tsx
index d125415..bd515a8 100644
--- a/apps/expo/src/screens/create-reviewer/index.tsx
+++ b/apps/expo/src/screens/create-reviewer/index.tsx
@@ -726,7 +726,7 @@ export const CreateReviewerScreen = ({
isVisible={openAlert}
alertTitle={"Are you sure?"}
alertDescription={
- "You will lose all unsaved progress if you exit this screen"
+ "You will lose all unsaved changes if you exit this screen"
}
confirmButtonText={"Yes"}
isCancelButtonVisible={true}
diff --git a/apps/expo/src/screens/edit-collection/index.tsx b/apps/expo/src/screens/edit-collection/index.tsx
index 286a717..61d4f43 100644
--- a/apps/expo/src/screens/edit-collection/index.tsx
+++ b/apps/expo/src/screens/edit-collection/index.tsx
@@ -349,7 +349,7 @@ export const EditCollection: FC> = ({
isVisible={openAlert}
alertTitle={"Are you sure?"}
alertDescription={
- "You will lose all unsaved progress if you exit this screen"
+ "You will lose all unsaved changes if you exit this screen"
}
confirmButtonText={"Yes"}
isCancelButtonVisible={true}
diff --git a/apps/expo/src/screens/edit-personal-info.tsx b/apps/expo/src/screens/edit-personal-info.tsx
index 088dde8..90be475 100644
--- a/apps/expo/src/screens/edit-personal-info.tsx
+++ b/apps/expo/src/screens/edit-personal-info.tsx
@@ -330,7 +330,7 @@ export const EditPersonalInfoScreen = () => {
isVisible={openAlert}
alertTitle={"Are you sure?"}
alertDescription={
- "You will lose all unsaved progress if you exit this screen"
+ "You will lose all unsaved changes if you exit this screen"
}
confirmButtonText={"Yes"}
isCancelButtonVisible={true}