Route /chats/new to ChatIndex

This commit is contained in:
Alex Gleason
2022-09-28 19:16:20 -05:00
parent 2791d3453a
commit e582eda17e
2 changed files with 6 additions and 0 deletions

View File

@ -29,6 +29,10 @@ const ChatPageSidebar = () => {
history.push(`/chats/${chat.id}`);
};
const handleChatCreate = () => {
history.push('/chats/new');
};
return (
<Stack space={4} className='h-full'>
<Stack space={4} className='px-4 pt-4'>
@ -38,6 +42,7 @@ const ChatPageSidebar = () => {
<IconButton
src={require('@tabler/icons/edit.svg')}
iconClassName='w-5 h-5 text-gray-600'
onClick={handleChatCreate}
/>
</HStack>

View File

@ -243,6 +243,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
{features.profileDirectory && <WrappedRoute path='/directory' publicRoute page={DefaultPage} component={Directory} content={children} />}
{features.chats && <WrappedRoute path='/chats' exact page={ChatsPage} component={ChatIndex} content={children} />}
{features.chats && <WrappedRoute path='/chats/new' page={ChatsPage} component={ChatIndex} content={children} />}
{features.chats && <WrappedRoute path='/chats/:chatId' page={ChatsPage} component={ChatIndex} content={children} />}
<WrappedRoute path='/follow_requests' page={DefaultPage} component={FollowRequests} content={children} />