mirror of
https://github.com/hanzo-io/team.git
synced 2026-11-02 17:26:48 +00:00
* feat: Camera functionality and UI changes * chore: moved all buttons to Buttons folder * chore: add back comments --------- Co-authored-by: Nikhil Kothari <[email protected]>
44 lines
1.6 KiB
TypeScript
44 lines
1.6 KiB
TypeScript
import { Stack, useLocalSearchParams } from 'expo-router';
|
|
import { useCurrentChannelData } from '@hooks/useCurrentChannelData';
|
|
import { useColorScheme } from '@hooks/useColorScheme';
|
|
import DMChannelHeader from '@components/features/chat/ChatHeader/DMChannelHeader';
|
|
import ChannelHeader from '@components/features/chat/ChatHeader/ChannelHeader';
|
|
import HeaderBackButton from '@components/common/Buttons/HeaderBackButton';
|
|
import ChatLayout from '@components/features/chat/ChatLayout';
|
|
import CommonErrorBoundary from '@components/common/CommonErrorBoundary';
|
|
|
|
const Chat = () => {
|
|
|
|
const { id } = useLocalSearchParams()
|
|
const { channel } = useCurrentChannelData(id as string)
|
|
const { colors } = useColorScheme()
|
|
|
|
return (
|
|
<>
|
|
<Stack.Screen options={{
|
|
headerStyle: { backgroundColor: colors.background },
|
|
headerLeft: () => <HeaderBackButton />,
|
|
title: id as string,
|
|
headerTitle: () => {
|
|
return (
|
|
<>
|
|
{channel && <>
|
|
{channel.type === 'dm' ?
|
|
<DMChannelHeader channelData={channel.channelData} /> :
|
|
<ChannelHeader channelData={channel.channelData} />
|
|
}
|
|
</>}
|
|
</>
|
|
)
|
|
}
|
|
}} />
|
|
|
|
<ChatLayout channelID={id as string} pinnedMessagesString={channel?.channelData.pinned_messages_string} />
|
|
|
|
</>
|
|
)
|
|
}
|
|
|
|
export default Chat
|
|
|
|
export const ErrorBoundary = CommonErrorBoundary |