Lazy load tooltip

This commit is contained in:
Gabe Kangas
2023-01-09 16:09:13 -08:00
parent bd3c81c353
commit 29882f1291
7 changed files with 46 additions and 32 deletions

View File

@@ -1,12 +1,20 @@
import { Layout, Tag, Tooltip } from 'antd';
import { Layout, Tag } from 'antd';
import { FC } from 'react';
import cn from 'classnames';
import { UserDropdown } from '../../common/UserDropdown/UserDropdown';
import dynamic from 'next/dynamic';
import { OwncastLogo } from '../../common/OwncastLogo/OwncastLogo';
import styles from './Header.module.scss';
const { Header: AntHeader } = Layout;
// Lazy loaded components
const UserDropdown = dynamic(() =>
import('../../common/UserDropdown/UserDropdown').then(mod => mod.UserDropdown),
);
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
export type HeaderComponentProps = {
name: string;
chatAvailable: boolean;