Lazy load tooltip
This commit is contained in:
@@ -4,7 +4,7 @@ import Link from 'next/link';
|
|||||||
import Head from 'next/head';
|
import Head from 'next/head';
|
||||||
import { differenceInSeconds } from 'date-fns';
|
import { differenceInSeconds } from 'date-fns';
|
||||||
import { useRouter } from 'next/router';
|
import { useRouter } from 'next/router';
|
||||||
import { Layout, Menu, Alert, Button, Space, Tooltip } from 'antd';
|
import { Layout, Menu, Alert, Button, Space } from 'antd';
|
||||||
import {
|
import {
|
||||||
SettingOutlined,
|
SettingOutlined,
|
||||||
HomeOutlined,
|
HomeOutlined,
|
||||||
@@ -19,6 +19,7 @@ import {
|
|||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import { upgradeVersionAvailable } from '../utils/apis';
|
import { upgradeVersionAvailable } from '../utils/apis';
|
||||||
import { parseSecondsToDurationString } from '../utils/format';
|
import { parseSecondsToDurationString } from '../utils/format';
|
||||||
|
|
||||||
@@ -33,6 +34,10 @@ import { UpdateArgs } from '../types/config-section';
|
|||||||
|
|
||||||
import FediverseIcon from '../assets/images/fediverse-black.png';
|
import FediverseIcon from '../assets/images/fediverse-black.png';
|
||||||
|
|
||||||
|
// Lazy loaded components
|
||||||
|
|
||||||
|
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
|
||||||
|
|
||||||
export type MainLayoutProps = {
|
export type MainLayoutProps = {
|
||||||
children: ReactNode;
|
children: ReactNode;
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -1,17 +1,22 @@
|
|||||||
// Custom component for AntDesign Button that makes an api call, then displays a confirmation icon upon
|
// Custom component for AntDesign Button that makes an api call, then displays a confirmation icon upon
|
||||||
import React, { useState, useEffect, FC } from 'react';
|
import React, { useState, useEffect, FC } from 'react';
|
||||||
import { Button, Tooltip } from 'antd';
|
import { Button } from 'antd';
|
||||||
import {
|
import {
|
||||||
EyeOutlined,
|
EyeOutlined,
|
||||||
EyeInvisibleOutlined,
|
EyeInvisibleOutlined,
|
||||||
CheckCircleFilled,
|
CheckCircleFilled,
|
||||||
ExclamationCircleFilled,
|
ExclamationCircleFilled,
|
||||||
} from '@ant-design/icons';
|
} from '@ant-design/icons';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import { fetchData, UPDATE_CHAT_MESSGAE_VIZ } from '../utils/apis';
|
import { fetchData, UPDATE_CHAT_MESSGAE_VIZ } from '../utils/apis';
|
||||||
import { MessageType } from '../types/chat';
|
import { MessageType } from '../types/chat';
|
||||||
import { OUTCOME_TIMEOUT } from '../pages/admin/chat/messages';
|
import { OUTCOME_TIMEOUT } from '../pages/admin/chat/messages';
|
||||||
import { isEmptyObject } from '../utils/format';
|
import { isEmptyObject } from '../utils/format';
|
||||||
|
|
||||||
|
// Lazy loaded components
|
||||||
|
|
||||||
|
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
|
||||||
|
|
||||||
export type MessageToggleProps = {
|
export type MessageToggleProps = {
|
||||||
isVisible: boolean;
|
isVisible: boolean;
|
||||||
message: MessageType;
|
message: MessageType;
|
||||||
|
|||||||
@@ -1,11 +1,12 @@
|
|||||||
// This displays a clickable user name (or whatever children element you provide), and displays a simple tooltip of created time. OnClick a modal with more information about the user is displayed.
|
// This displays a clickable user name (or whatever children element you provide), and displays a simple tooltip of created time. OnClick a modal with more information about the user is displayed.
|
||||||
|
|
||||||
import { useState, ReactNode, FC } from 'react';
|
import { useState, ReactNode, FC } from 'react';
|
||||||
import { Divider, Modal, Tooltip, Typography, Row, Col, Space } from 'antd';
|
import { Divider, Modal, Typography, Row, Col, Space } from 'antd';
|
||||||
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
|
import formatDistanceToNow from 'date-fns/formatDistanceToNow';
|
||||||
import format from 'date-fns/format';
|
import format from 'date-fns/format';
|
||||||
import { uniq } from 'lodash';
|
import { uniq } from 'lodash';
|
||||||
|
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import { BanUserButton } from './BanUserButton';
|
import { BanUserButton } from './BanUserButton';
|
||||||
import { ModeratorUserButton } from './ModeratorUserButton';
|
import { ModeratorUserButton } from './ModeratorUserButton';
|
||||||
|
|
||||||
@@ -13,6 +14,10 @@ import { User, UserConnectionInfo } from '../types/chat';
|
|||||||
import { formatDisplayDate } from './UserTable';
|
import { formatDisplayDate } from './UserTable';
|
||||||
import { formatUAstring } from '../utils/format';
|
import { formatUAstring } from '../utils/format';
|
||||||
|
|
||||||
|
// Lazy loaded components
|
||||||
|
|
||||||
|
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
|
||||||
|
|
||||||
export type UserPopoverProps = {
|
export type UserPopoverProps = {
|
||||||
user: User;
|
user: User;
|
||||||
connectionInfo?: UserConnectionInfo | null;
|
connectionInfo?: UserConnectionInfo | null;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
import React, { useState, useContext, useEffect } from 'react';
|
import React, { useState, useContext, useEffect } from 'react';
|
||||||
import { Button, Tooltip, Collapse, Typography } from 'antd';
|
import { Button, Collapse, Typography } from 'antd';
|
||||||
import { CopyOutlined, RedoOutlined } from '@ant-design/icons';
|
import { CopyOutlined, RedoOutlined } from '@ant-design/icons';
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import { TEXTFIELD_TYPE_NUMBER, TEXTFIELD_TYPE_PASSWORD, TEXTFIELD_TYPE_URL } from './TextField';
|
import { TEXTFIELD_TYPE_NUMBER, TEXTFIELD_TYPE_PASSWORD, TEXTFIELD_TYPE_URL } from './TextField';
|
||||||
import { TextFieldWithSubmit } from './TextFieldWithSubmit';
|
import { TextFieldWithSubmit } from './TextFieldWithSubmit';
|
||||||
import { ServerStatusContext } from '../../utils/server-status-context';
|
import { ServerStatusContext } from '../../utils/server-status-context';
|
||||||
@@ -15,6 +16,10 @@ import {
|
|||||||
import { UpdateArgs } from '../../types/config-section';
|
import { UpdateArgs } from '../../types/config-section';
|
||||||
import { ResetYP } from './ResetYP';
|
import { ResetYP } from './ResetYP';
|
||||||
|
|
||||||
|
// Lazy loaded components
|
||||||
|
|
||||||
|
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
|
||||||
|
|
||||||
const { Panel } = Collapse;
|
const { Panel } = Collapse;
|
||||||
|
|
||||||
export const EditInstanceDetails = () => {
|
export const EditInstanceDetails = () => {
|
||||||
|
|||||||
@@ -1,12 +1,20 @@
|
|||||||
import { Layout, Tag, Tooltip } from 'antd';
|
import { Layout, Tag } from 'antd';
|
||||||
import { FC } from 'react';
|
import { FC } from 'react';
|
||||||
import cn from 'classnames';
|
import cn from 'classnames';
|
||||||
import { UserDropdown } from '../../common/UserDropdown/UserDropdown';
|
import dynamic from 'next/dynamic';
|
||||||
import { OwncastLogo } from '../../common/OwncastLogo/OwncastLogo';
|
import { OwncastLogo } from '../../common/OwncastLogo/OwncastLogo';
|
||||||
import styles from './Header.module.scss';
|
import styles from './Header.module.scss';
|
||||||
|
|
||||||
const { Header: AntHeader } = Layout;
|
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 = {
|
export type HeaderComponentProps = {
|
||||||
name: string;
|
name: string;
|
||||||
chatAvailable: boolean;
|
chatAvailable: boolean;
|
||||||
|
|||||||
@@ -1,21 +1,10 @@
|
|||||||
import React, { useState, useEffect } from 'react';
|
import React, { useState, useEffect } from 'react';
|
||||||
import {
|
import { Table, Tag, Space, Button, Modal, Checkbox, Input, Typography, Row, Col } from 'antd';
|
||||||
Table,
|
|
||||||
Tag,
|
|
||||||
Space,
|
|
||||||
Button,
|
|
||||||
Modal,
|
|
||||||
Checkbox,
|
|
||||||
Input,
|
|
||||||
Typography,
|
|
||||||
Tooltip,
|
|
||||||
Row,
|
|
||||||
Col,
|
|
||||||
} from 'antd';
|
|
||||||
import { DeleteOutlined } from '@ant-design/icons';
|
import { DeleteOutlined } from '@ant-design/icons';
|
||||||
|
|
||||||
import format from 'date-fns/format';
|
import format from 'date-fns/format';
|
||||||
|
|
||||||
|
import dynamic from 'next/dynamic';
|
||||||
import {
|
import {
|
||||||
fetchData,
|
fetchData,
|
||||||
ACCESS_TOKENS,
|
ACCESS_TOKENS,
|
||||||
@@ -25,6 +14,10 @@ import {
|
|||||||
|
|
||||||
const { Title, Paragraph } = Typography;
|
const { Title, Paragraph } = Typography;
|
||||||
|
|
||||||
|
// Lazy loaded components
|
||||||
|
|
||||||
|
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
|
||||||
|
|
||||||
const availableScopes = {
|
const availableScopes = {
|
||||||
CAN_SEND_SYSTEM_MESSAGES: {
|
CAN_SEND_SYSTEM_MESSAGES: {
|
||||||
name: 'System messages',
|
name: 'System messages',
|
||||||
|
|||||||
@@ -1,22 +1,15 @@
|
|||||||
/* eslint-disable react/destructuring-assignment */
|
/* eslint-disable react/destructuring-assignment */
|
||||||
import { DeleteOutlined } from '@ant-design/icons';
|
import { DeleteOutlined } from '@ant-design/icons';
|
||||||
import {
|
import { Button, Checkbox, Col, Input, Modal, Row, Space, Table, Tag, Typography } from 'antd';
|
||||||
Button,
|
import dynamic from 'next/dynamic';
|
||||||
Checkbox,
|
|
||||||
Col,
|
|
||||||
Input,
|
|
||||||
Modal,
|
|
||||||
Row,
|
|
||||||
Space,
|
|
||||||
Table,
|
|
||||||
Tag,
|
|
||||||
Tooltip,
|
|
||||||
Typography,
|
|
||||||
} from 'antd';
|
|
||||||
import React, { useEffect, useState } from 'react';
|
import React, { useEffect, useState } from 'react';
|
||||||
import { CREATE_WEBHOOK, DELETE_WEBHOOK, fetchData, WEBHOOKS } from '../../utils/apis';
|
import { CREATE_WEBHOOK, DELETE_WEBHOOK, fetchData, WEBHOOKS } from '../../utils/apis';
|
||||||
import { isValidUrl, DEFAULT_TEXTFIELD_URL_PATTERN } from '../../utils/urls';
|
import { isValidUrl, DEFAULT_TEXTFIELD_URL_PATTERN } from '../../utils/urls';
|
||||||
|
|
||||||
|
// Lazy loaded components
|
||||||
|
|
||||||
|
const Tooltip = dynamic(() => import('antd').then(mod => mod.Tooltip));
|
||||||
|
|
||||||
const { Title, Paragraph } = Typography;
|
const { Title, Paragraph } = Typography;
|
||||||
|
|
||||||
const availableEvents = {
|
const availableEvents = {
|
||||||
|
|||||||
Reference in New Issue
Block a user