Skip to content

Commit

Permalink
Merge branch 'HansGabriel:main' into main
Browse files Browse the repository at this point in the history
  • Loading branch information
3LL4N authored Dec 5, 2023
2 parents 9af6213 + 800002f commit ff74ff9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 16 deletions.
19 changes: 4 additions & 15 deletions apps/expo/src/screens/create-question/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -669,6 +669,10 @@ export const CreateQuestionScreen: FC = () => {
<QuestionOptionsDropdown
isDeleting={isDeleting}
setOpenDeleteAlert={() => setOpenDeleteAlert(true)}
isSaved={!isSaved}
handleSaveAnswer={handleSaveAnswer(() => {
setIsSaved(false);
})}
/>
}
backIcon={<Feather name="x" size={24} color="black" />}
Expand Down Expand Up @@ -822,21 +826,6 @@ export const CreateQuestionScreen: FC = () => {
.with(undefined, () => <></>)
.exhaustive()}

<TouchableOpacity
className={`mt-10 w-[50%] items-center justify-center self-center rounded-[100px] border-b border-l border-r border-t border-indigo-800 bg-violet-600 py-[18px] ${
!isSaved ? "opacity-50" : ""
}`}
// eslint-disable-next-line @typescript-eslint/no-empty-function
onPress={handleSaveAnswer(() => {
setIsSaved(false);
})}
disabled={!isSaved}
>
<Text className="text-center text-base font-bold text-white">
Save
</Text>
</TouchableOpacity>

<Modal
animationType="fade"
transparent={true}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,15 @@ import type { FC } from "react";
interface Props {
isDeleting: boolean;
setOpenDeleteAlert: () => void;
isSaved: boolean;
handleSaveAnswer: () => void;
}

const QuestionOptionsDropdown: FC<Props> = ({
isDeleting,
setOpenDeleteAlert,
isSaved,
handleSaveAnswer,
}) => {
return (
<View className="relative flex-row space-x-4">
Expand All @@ -22,7 +26,7 @@ const QuestionOptionsDropdown: FC<Props> = ({
<AntDesign name="delete" size={24} color="red" />
)}
</TouchableOpacity>
<TouchableOpacity>
<TouchableOpacity disabled={isSaved} onPress={handleSaveAnswer}>
<Entypo name="save" size={25} color="rgb(79 70 229)" />
</TouchableOpacity>
</View>
Expand Down

0 comments on commit ff74ff9

Please sign in to comment.