mirror of
https://github.com/lemeow125/StudE-Frontend.git
synced 2025-05-17 03:48:06 +08:00
Fix some styling issues and improve pull up modal for groups/students list
This commit is contained in:
parent
8279665ab9
commit
4e1a73f6ed
4 changed files with 105 additions and 14 deletions
|
@ -254,7 +254,6 @@ export async function PatchStudentStatus(info: StudentStatusPatchType) {
|
|||
})
|
||||
.catch((error) => {
|
||||
let error_message = ParseError(error);
|
||||
console.log("DEBUG", error.response.data);
|
||||
return [false, error_message];
|
||||
});
|
||||
}
|
||||
|
|
|
@ -31,8 +31,8 @@ export default function CustomDrawerContent(props: {}) {
|
|||
const status = useSelector((state: RootState) => state.status);
|
||||
const dispatch = useDispatch();
|
||||
const queryClient = useQueryClient();
|
||||
const debug = false;
|
||||
const toast = useToast();
|
||||
const debug_disable_clear_on_logout = true;
|
||||
const stop_studying_logout = useMutation({
|
||||
mutationFn: async (info: StudentStatusPatchType) => {
|
||||
const data = await PatchStudentStatus(info);
|
||||
|
@ -77,10 +77,17 @@ export default function CustomDrawerContent(props: {}) {
|
|||
</View>
|
||||
|
||||
<DrawerButton
|
||||
onPress={() => {
|
||||
stop_studying_logout.mutate({
|
||||
active: false,
|
||||
});
|
||||
onPress={async () => {
|
||||
if (debug_disable_clear_on_logout) {
|
||||
queryClient.clear();
|
||||
dispatch(logout());
|
||||
await AsyncStorage.clear();
|
||||
navigation.navigate("Login");
|
||||
} else {
|
||||
stop_studying_logout.mutate({
|
||||
active: false,
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
<LogoutIcon size={32} />
|
||||
|
@ -125,10 +132,17 @@ export default function CustomDrawerContent(props: {}) {
|
|||
<Text style={styles.text_white_medium}>Subjects</Text>
|
||||
</DrawerButton>
|
||||
<DrawerButton
|
||||
onPress={() => {
|
||||
stop_studying_logout.mutate({
|
||||
active: false,
|
||||
});
|
||||
onPress={async () => {
|
||||
if (debug_disable_clear_on_logout) {
|
||||
queryClient.clear();
|
||||
dispatch(logout());
|
||||
await AsyncStorage.clear();
|
||||
navigation.navigate("Login");
|
||||
} else {
|
||||
stop_studying_logout.mutate({
|
||||
active: false,
|
||||
});
|
||||
}
|
||||
}}
|
||||
>
|
||||
<LogoutIcon size={32} />
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue