ChatsPage: add settings cog

This commit is contained in:
Alex Gleason 2022-09-28 19:39:22 -05:00
parent f8199ab701
commit de78926142
No known key found for this signature in database
GPG Key ID: 7211D1F99744FBB7
3 changed files with 22 additions and 5 deletions

View File

@ -9,6 +9,7 @@ import { useChat } from 'soapbox/queries/chats';
import ChatPageMain from './components/chat-page-main'; import ChatPageMain from './components/chat-page-main';
import ChatPageNew from './components/chat-page-new'; import ChatPageNew from './components/chat-page-new';
import ChatPageSidebar from './components/chat-page-sidebar'; import ChatPageSidebar from './components/chat-page-sidebar';
import Welcome from './components/welcome';
interface IChatPage { interface IChatPage {
chatId?: string, chatId?: string,
@ -78,6 +79,9 @@ const ChatPage: React.FC<IChatPage> = ({ chatId }) => {
<Route path='/chats/new'> <Route path='/chats/new'>
<ChatPageNew /> <ChatPageNew />
</Route> </Route>
<Route path='/chats/settings'>
<Welcome />
</Route>
<Route> <Route>
<ChatPageMain /> <ChatPageMain />
</Route> </Route>

View File

@ -33,17 +33,29 @@ const ChatPageSidebar = () => {
history.push('/chats/new'); history.push('/chats/new');
}; };
const handleSettingsClick = () => {
history.push('/chats/settings');
};
return ( return (
<Stack space={4} className='h-full'> <Stack space={4} className='h-full'>
<Stack space={4} className='px-4 pt-4'> <Stack space={4} className='px-4 pt-4'>
<HStack alignItems='center' justifyContent='between'> <HStack alignItems='center' justifyContent='between'>
<CardTitle title={intl.formatMessage(messages.title)} /> <CardTitle title={intl.formatMessage(messages.title)} />
<IconButton <HStack space={1}>
src={require('@tabler/icons/edit.svg')} <IconButton
iconClassName='w-5 h-5 text-gray-600' src={require('@tabler/icons/settings.svg')}
onClick={handleChatCreate} iconClassName='w-5 h-5 text-gray-600'
/> onClick={handleSettingsClick}
/>
<IconButton
src={require('@tabler/icons/edit.svg')}
iconClassName='w-5 h-5 text-gray-600'
onClick={handleChatCreate}
/>
</HStack>
</HStack> </HStack>
{features.chatsSearch && ( {features.chatsSearch && (

View File

@ -244,6 +244,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => {
{features.chats && <WrappedRoute path='/chats' exact page={ChatsPage} component={ChatIndex} 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/new' page={ChatsPage} component={ChatIndex} content={children} />}
{features.chats && <WrappedRoute path='/chats/settings' page={ChatsPage} component={ChatIndex} content={children} />}
{features.chats && <WrappedRoute path='/chats/:chatId' 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} /> <WrappedRoute path='/follow_requests' page={DefaultPage} component={FollowRequests} content={children} />