Fix some React lifecycle and rendering errors that exist in build
This commit is contained in:
@@ -149,7 +149,7 @@ const MobileContent = ({
|
||||
supportsBrowserNotifications,
|
||||
}) => {
|
||||
if (!currentUser) {
|
||||
return null;
|
||||
return <Skeleton loading active paragraph={{ rows: 7 }} />;
|
||||
}
|
||||
const { id, displayName } = currentUser;
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { Tag } from 'antd';
|
||||
import { Tag, Tooltip } from 'antd';
|
||||
import { FC } from 'react';
|
||||
import cn from 'classnames';
|
||||
import dynamic from 'next/dynamic';
|
||||
@@ -7,14 +7,13 @@ import styles from './Header.module.scss';
|
||||
|
||||
// Lazy loaded components
|
||||
|
||||
const UserDropdown = dynamic(() =>
|
||||
import('../../common/UserDropdown/UserDropdown').then(mod => mod.UserDropdown),
|
||||
const UserDropdown = dynamic(
|
||||
() => import('../../common/UserDropdown/UserDropdown').then(mod => mod.UserDropdown),
|
||||
{
|
||||
ssr: false,
|
||||
},
|
||||
);
|
||||
|
||||
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip), {
|
||||
ssr: false,
|
||||
});
|
||||
|
||||
export type HeaderComponentProps = {
|
||||
name: string;
|
||||
chatAvailable: boolean;
|
||||
|
||||
@@ -8,16 +8,18 @@ import styles from './Sidebar.module.scss';
|
||||
import { currentUserAtom, visibleChatMessagesSelector } from '../../stores/ClientConfigStore';
|
||||
|
||||
// Lazy loaded components
|
||||
const ChatContainer = dynamic(() =>
|
||||
import('../../chat/ChatContainer/ChatContainer').then(mod => mod.ChatContainer),
|
||||
const ChatContainer = dynamic(
|
||||
() => import('../../chat/ChatContainer/ChatContainer').then(mod => mod.ChatContainer),
|
||||
{
|
||||
ssr: false,
|
||||
},
|
||||
);
|
||||
|
||||
export const Sidebar: FC = () => {
|
||||
const currentUser = useRecoilValue(currentUserAtom);
|
||||
const messages = useRecoilValue<ChatMessage[]>(visibleChatMessagesSelector);
|
||||
|
||||
if (!currentUser) {
|
||||
return null;
|
||||
return <Sider className={styles.root} collapsedWidth={0} width={320} />;
|
||||
}
|
||||
|
||||
const { id, isModerator, displayName } = currentUser;
|
||||
|
||||
Reference in New Issue
Block a user