Last active
April 14, 2020 13:34
-
-
Save vishalnarkhede/20407f709445ccac9d5a487d0f84a917 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {DateSeparator} from './src/components/DateSeparator'; | |
import {MessageSlack} from './src/components/MessageSlack'; | |
function ChannelScreen({navigation, route}) { | |
const [channel, setChannel] = useState(null); | |
useEffect(() => { | |
if (!channel) { | |
navigation.openDrawer(); | |
} | |
const channelId = route.params ? route.params.channelId : null; | |
const _channel = chatClient.channel('messaging', channelId); | |
setChannel(_channel); | |
}, [route.params]); | |
return ( | |
<SafeAreaView style={styles.channelScreenSaveAreaView}> | |
<View style={styles.channelScreenContainer}> | |
<ChannelHeader | |
navigation={navigation} | |
channel={channel} | |
client={chatClient} | |
/> | |
<View style={styles.chatContainer}> | |
<Chat client={chatClient}> | |
<Channel channel={channel}> | |
<MessageList | |
Message={MessageSlack} | |
DateSeparator={DateSeparator} | |
/> | |
<MessageInput /> | |
</Channel> | |
</Chat> | |
</View> | |
</View> | |
</SafeAreaView> | |
); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment