Skip to content

Commit

Permalink
fix(messages): improve layout
Browse files Browse the repository at this point in the history
  • Loading branch information
lpezzolla committed Sep 18, 2023
1 parent a04f499 commit 3d2d7b9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/features/user/screens/MessageScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ScrollView } from 'react-native';

import { NativeStackScreenProps } from '@react-navigation/native-stack';

import { BottomBarSpacer } from '../../../core/components/BottomBarSpacer';
import { useGetMessages } from '../../../core/queries/studentHooks';
import { MessageScreenContent } from '../components/MessageScreenContent';
import { UserStackParamList } from '../components/UserNavigator';
Expand All @@ -16,6 +17,7 @@ export const MessageScreen = ({ route }: Props) => {
return (
<ScrollView contentInsetAdjustmentBehavior="automatic">
{message && <MessageScreenContent message={message} />}
<BottomBarSpacer />
</ScrollView>
);
};
7 changes: 7 additions & 0 deletions src/features/user/screens/UnreadMessagesModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import {
useInvalidateMessages,
useMarkMessageAsRead,
} from '../../../core/queries/studentHooks';
import { tabBarStyle } from '../../../utils/tab-bar';
import { MessageScreenContent } from '../components/MessageScreenContent';

type Props = NativeStackScreenProps<any, 'MessagesModal'>;
Expand Down Expand Up @@ -58,13 +59,19 @@ export const UnreadMessagesModal = ({ navigation }: Props) => {
total: messagesToReadCount,
}),
});
navigation.getParent()!.setOptions({
tabBarStyle: { display: 'none' },
});
}, [t, messagesToRead, messagesReadCount, navigation, messagesToReadCount]);

useFocusEffect(
useCallback(() => {
// Invalidate message list when the modal is closing
return () => {
invalidateMessages.run();
navigation.getParent()!.setOptions({
tabBarStyle: tabBarStyle,
});
};
}, []),
);
Expand Down

0 comments on commit 3d2d7b9

Please sign in to comment.