pl-fe: rename pages so they make more sense
Signed-off-by: nicole mikołajczyk <git@mkljczk.pl>
This commit is contained in:
@ -6,9 +6,9 @@ import Stack from 'pl-fe/components/ui/stack';
|
||||
import { chatsEmptyRoute } from 'pl-fe/features/ui/router';
|
||||
import { useChats } from 'pl-fe/queries/chats';
|
||||
|
||||
import ChatPageSidebar from './components/chat-page-sidebar';
|
||||
import ChatsPageSidebar from './components/chats-page-sidebar';
|
||||
|
||||
const ChatPage: React.FC = () => {
|
||||
const ChatsPage: React.FC = () => {
|
||||
const { chatsQuery: { data: chats } } = useChats();
|
||||
|
||||
const isSidebarHidden = !useMatch({ from: chatsEmptyRoute.id, shouldThrow: false }) || chats?.length === 0;
|
||||
@ -57,7 +57,7 @@ const ChatPage: React.FC = () => {
|
||||
'hidden sm:block': isSidebarHidden,
|
||||
})}
|
||||
>
|
||||
<ChatPageSidebar />
|
||||
<ChatsPageSidebar />
|
||||
</Stack>
|
||||
|
||||
<Stack
|
||||
@ -72,4 +72,4 @@ const ChatPage: React.FC = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { ChatPage as default };
|
||||
export { ChatsPage as default };
|
||||
@ -32,7 +32,7 @@ const messages = defineMessages({
|
||||
leaveChat: { id: 'chat_settings.options.leave_chat', defaultMessage: 'Leave chat' },
|
||||
});
|
||||
|
||||
const ChatPageMain = () => {
|
||||
const ChatsPageChat = () => {
|
||||
const intl = useIntl();
|
||||
const features = useFeatures();
|
||||
const navigate = useNavigate();
|
||||
@ -153,4 +153,4 @@ const ChatPageMain = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { ChatPageMain as default };
|
||||
export { ChatsPageChat as default };
|
||||
@ -5,7 +5,7 @@ import { useChats } from 'pl-fe/queries/chats';
|
||||
import BlankslateEmpty from './blankslate-empty';
|
||||
import BlankslateWithChats from './blankslate-with-chats';
|
||||
|
||||
const ChatPageMain = () => {
|
||||
const ChatsPageEmpty = () => {
|
||||
const { chatsQuery: { data: chats, isLoading } } = useChats();
|
||||
|
||||
if (isLoading) {
|
||||
@ -19,4 +19,4 @@ const ChatPageMain = () => {
|
||||
return <BlankslateEmpty />;
|
||||
};
|
||||
|
||||
export { ChatPageMain as default };
|
||||
export { ChatsPageEmpty as default };
|
||||
@ -13,11 +13,8 @@ const messages = defineMessages({
|
||||
title: { id: 'chat.new_message.title', defaultMessage: 'New Message' },
|
||||
});
|
||||
|
||||
interface IChatPageNew {
|
||||
}
|
||||
|
||||
/** New message form to create a chat. */
|
||||
const ChatPageNew: React.FC<IChatPageNew> = () => {
|
||||
const ChatsPageNew: React.FC = () => {
|
||||
const intl = useIntl();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -40,4 +37,4 @@ const ChatPageNew: React.FC<IChatPageNew> = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { ChatPageNew as default };
|
||||
export { ChatsPageNew as default };
|
||||
@ -30,7 +30,7 @@ const messages = defineMessages({
|
||||
submit: { id: 'chat.page_settings.submit', defaultMessage: 'Save' },
|
||||
});
|
||||
|
||||
const ChatPageSettings = () => {
|
||||
const ChatsPageSettings = () => {
|
||||
const { account } = useOwnAccount();
|
||||
const intl = useIntl();
|
||||
const navigate = useNavigate();
|
||||
@ -98,4 +98,4 @@ const ChatPageSettings = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { ChatPageSettings as default };
|
||||
export { ChatsPageSettings as default };
|
||||
@ -12,7 +12,7 @@ import { usePlFeConfig } from 'pl-fe/hooks/use-pl-fe-config';
|
||||
|
||||
import Shoutbox from '../../shoutbox';
|
||||
|
||||
const ChatPageShoutbox = () => {
|
||||
const ChatsPageShoutbox = () => {
|
||||
const navigate = useNavigate();
|
||||
const instance = useInstance();
|
||||
const { logo } = usePlFeConfig();
|
||||
@ -48,4 +48,4 @@ const ChatPageShoutbox = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { ChatPageShoutbox as default };
|
||||
export { ChatsPageShoutbox as default };
|
||||
@ -15,7 +15,7 @@ const messages = defineMessages({
|
||||
title: { id: 'column.chats', defaultMessage: 'Chats' },
|
||||
});
|
||||
|
||||
const ChatPageSidebar = () => {
|
||||
const ChatsPageSidebar = () => {
|
||||
const intl = useIntl();
|
||||
const navigate = useNavigate();
|
||||
|
||||
@ -64,4 +64,4 @@ const ChatPageSidebar = () => {
|
||||
);
|
||||
};
|
||||
|
||||
export { ChatPageSidebar as default };
|
||||
export { ChatsPageSidebar as default };
|
||||
@ -39,11 +39,11 @@ import StatusLayout from 'pl-fe/layouts/status-layout';
|
||||
import { instanceInitialState } from 'pl-fe/reducers/instance';
|
||||
import { isStandalone } from 'pl-fe/utils/state';
|
||||
|
||||
import ChatPageChat from '../../chats/components/chat-page/components/chat-page-chat';
|
||||
import ChatPageMain from '../../chats/components/chat-page/components/chat-page-main';
|
||||
import ChatPageNew from '../../chats/components/chat-page/components/chat-page-new';
|
||||
import ChatPageSettings from '../../chats/components/chat-page/components/chat-page-settings';
|
||||
import ChatPageShoutbox from '../../chats/components/chat-page/components/chat-page-shoutbox';
|
||||
import ChatsPageChat from '../../chats/components/chats-page/components/chats-page-chat';
|
||||
import ChatsPageEmpty from '../../chats/components/chats-page/components/chats-page-empty';
|
||||
import ChatsPageNew from '../../chats/components/chats-page/components/chats-page-new';
|
||||
import ChatsPageSettings from '../../chats/components/chats-page/components/chats-page-settings';
|
||||
import ChatsPageShoutbox from '../../chats/components/chats-page/components/chats-page-shoutbox';
|
||||
import ColumnLoading from '../components/column-loading';
|
||||
import {
|
||||
AboutPage,
|
||||
@ -567,31 +567,31 @@ export const chatsRoute = createRoute({
|
||||
export const chatsNewRoute = createRoute({
|
||||
getParentRoute: () => chatsRoute,
|
||||
path: '/new',
|
||||
component: ChatPageNew,
|
||||
component: ChatsPageNew,
|
||||
});
|
||||
|
||||
export const chatsSettingsRoute = createRoute({
|
||||
getParentRoute: () => chatsRoute,
|
||||
path: '/settings',
|
||||
component: ChatPageSettings,
|
||||
component: ChatsPageSettings,
|
||||
});
|
||||
|
||||
export const shoutboxRoute = createRoute({
|
||||
getParentRoute: () => chatsRoute,
|
||||
path: '/shoutbox',
|
||||
component: ChatPageShoutbox,
|
||||
component: ChatsPageShoutbox,
|
||||
});
|
||||
|
||||
export const chatRoute = createRoute({
|
||||
getParentRoute: () => chatsRoute,
|
||||
path: '/$chatId',
|
||||
component: ChatPageChat,
|
||||
component: ChatsPageChat,
|
||||
});
|
||||
|
||||
export const chatsEmptyRoute = createRoute({
|
||||
getParentRoute: () => chatsRoute,
|
||||
path: '/',
|
||||
component: ChatPageMain,
|
||||
component: ChatsPageEmpty,
|
||||
});
|
||||
|
||||
// Follow requests and blocks
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import React from 'react';
|
||||
|
||||
import { ChatProvider } from 'pl-fe/contexts/chat-context';
|
||||
import ChatPage from 'pl-fe/features/chats/components/chat-page/chat-page';
|
||||
import ChatPage from 'pl-fe/features/chats/components/chats-page/chats-page';
|
||||
|
||||
const ChatIndex: React.FC = () => (
|
||||
<ChatProvider>
|
||||
|
||||
Reference in New Issue
Block a user