Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ class MainActivity : ReactActivity() {
window.statusBarColor = Color.TRANSPARENT

if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.Q) {
window.isNavigationBarContrastEnforced = false
window.isStatusBarContrastEnforced = false
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@
<style name="AppTheme" parent="Theme.AppCompat.DayNight.NoActionBar">
<item name="android:navigationBarColor">@android:color/transparent</item>
<item name="android:statusBarColor">@android:color/transparent</item>
<item name="android:enforceNavigationBarContrast">false</item>
</style>

</resources>
10 changes: 7 additions & 3 deletions examples/SampleApp/src/screens/ChannelDetailsScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { useCallback } from 'react';

import { StyleSheet } from 'react-native';
import { StyleSheet, View } from 'react-native';

import { SafeAreaView } from 'react-native-safe-area-context';

Expand Down Expand Up @@ -135,8 +135,12 @@ const ChannelDetailsScreenInner = () => {
ChannelMemberActionsSheet: MemberActionsSheet,
}}
>
<SafeAreaView edges={['left', 'right']} style={styles.flex}>
<ChannelDetails onBack={onBack} />
<SafeAreaView edges={['bottom', 'left', 'right']} style={styles.flex}>
{/* The toasts are positioned absolutely, which ignores the safe area's padding, so they need
a view inside it to keep them above the system navigation bar. */}
<View style={styles.flex}>
<ChannelDetails onBack={onBack} />
</View>
</SafeAreaView>
</WithComponents>
);
Expand Down
2 changes: 1 addition & 1 deletion examples/SampleApp/src/screens/ChannelFilesScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const ChannelFilesScreen: React.FC<ChannelFilesScreenProps> = ({
useTheme();

return (
<SafeAreaView edges={['left', 'right']} style={[styles.flex]}>
<SafeAreaView edges={['bottom', 'left', 'right']} style={[styles.flex]}>
<ScreenHeader titleText='Files' />
<ChannelDetailsContextProvider channel={channel}>
<View style={styles.flex}>
Expand Down
2 changes: 1 addition & 1 deletion examples/SampleApp/src/screens/ChannelImagesScreen.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export const ChannelImagesScreen: React.FC<ChannelImagesScreenProps> = ({
},
}) => {
return (
<SafeAreaView edges={['left', 'right']} style={[styles.flex]}>
<SafeAreaView edges={['bottom', 'left', 'right']} style={[styles.flex]}>
<ScreenHeader titleText='Photos and Videos' />
<ChannelDetailsContextProvider channel={channel}>
<View style={styles.flex}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ export const ChannelPinnedMessagesScreen: React.FC<ChannelPinnedMessagesScreenPr
}) => {
useTheme();
return (
<SafeAreaView edges={['left', 'right']} style={[styles.flex]}>
<SafeAreaView edges={['bottom', 'left', 'right']} style={[styles.flex]}>
<ScreenHeader titleText='Pinned Messages' />
<ChannelDetailsContextProvider channel={channel}>
<View style={styles.flex}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const NewGroupChannelAddMemberScreen: React.FC<Props> = ({ navigation })
}

return (
<SafeAreaView edges={['left', 'right']} style={styles.container}>
<SafeAreaView edges={['bottom', 'left', 'right']} style={styles.container}>
<ScreenHeader
onBack={onBackPress}
// eslint-disable-next-line react/no-unstable-nested-components
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ export const NewGroupChannelAssignNameScreen: React.FC<NewGroupChannelAssignName
};

return (
<SafeAreaView edges={['left', 'right']} style={styles.container}>
<SafeAreaView edges={['bottom', 'left', 'right']} style={styles.container}>
<ScreenHeader
// eslint-disable-next-line react/no-unstable-nested-components
RightContent={() => <ConfirmButton disabled={!groupName} onPress={onConfirm} />}
Expand Down
28 changes: 24 additions & 4 deletions examples/SampleApp/src/screens/ScheduledMessagesScreen.tsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,15 @@
import React from 'react';
import { StyleSheet } from 'react-native';
import { StyleSheet, View } from 'react-native';

import { SafeAreaView } from 'react-native-safe-area-context';
import { SafeAreaView, useSafeAreaInsets } from 'react-native-safe-area-context';

import type { RouteProp } from '@react-navigation/native';
import { Channel, ChannelScheduledMessages } from 'stream-chat-react-native';
import {
Channel,
ChannelScheduledMessages,
type ChannelScheduledMessagesProps,
useEditedScheduledMessage,
} from 'stream-chat-react-native';

import { ScreenHeader } from '../components/ScreenHeader';
import { useAppContext } from '../context/AppContext';
Expand Down Expand Up @@ -36,12 +41,27 @@ export const ScheduledMessagesScreen: React.FC<ScheduledMessagesScreenProps> = (
messageInputFloating={messageInputFloating}
>
<ScreenHeader titleText='Scheduled messages' />
<ChannelScheduledMessages view={thread?.scheduledMessages} />
<ScheduledMessagesContent view={thread?.scheduledMessages} />
</Channel>
</SafeAreaView>
);
};

/**
* The edit composer keeps itself above the system navigation bar, so the list reserves that space
* only while no edit is open.
*/
const ScheduledMessagesContent = ({ view }: Pick<ChannelScheduledMessagesProps, 'view'>) => {
const { bottom } = useSafeAreaInsets();
const { editedScheduledMessage } = useEditedScheduledMessage();

return (
<View style={[styles.flex, { paddingBottom: editedScheduledMessage ? 0 : bottom }]}>
<ChannelScheduledMessages view={view} />
</View>
);
};

const styles = StyleSheet.create({
flex: {
flex: 1,
Expand Down