import classNames from "classnames"; import React, { HTMLAttributes, ReactNode, useCallback, useRef } from "react"; import { Link } from "react-router-dom"; import { useButton } from "@react-aria/button"; import { AriaButtonProps } from "@react-types/button"; import { Room } from "matrix-js-sdk"; import styles from "./Header.module.css"; import { useModalTriggerState } from "./Modal"; import { Button } from "./button"; import { ReactComponent as Logo } from "./icons/Logo.svg"; import { ReactComponent as VideoIcon } from "./icons/Video.svg"; import { Subtitle } from "./typography/Typography"; import { Avatar, Size } from "./Avatar"; import { IncompatibleVersionModal } from "./IncompatibleVersionModal"; import { ReactComponent as ArrowLeftIcon } from "./icons/ArrowLeft.svg"; interface HeaderProps extends HTMLAttributes { children: ReactNode; className?: string; } export function Header({ children, className, ...rest }: HeaderProps) { return (
{children}
); } interface LeftNavProps extends HTMLAttributes { children: ReactNode; className?: string; hideMobile?: boolean; } export function LeftNav({ children, className, hideMobile, ...rest }: LeftNavProps) { return (
{children}
); } interface RightNavProps { children?: ReactNode; className?: string; hideMobile?: string; } export function RightNav({ children, className, hideMobile, ...rest }: RightNavProps) { return (
{children}
); } interface HeaderLogoProps { className?: string; } export function HeaderLogo({ className }: HeaderLogoProps) { return ( ); } interface RoomHeaderInfo { roomName: string; avatarUrl: string; } export function RoomHeaderInfo({ roomName, avatarUrl }: RoomHeaderInfo) { return ( <>
{roomName} ); } interface RoomSetupHeaderInfoProps extends AriaButtonProps<"button"> { roomName: string; avatarUrl: string; isEmbedded: boolean; } export function RoomSetupHeaderInfo({ roomName, avatarUrl, isEmbedded, ...rest }: RoomSetupHeaderInfoProps) { const ref = useRef(); const { buttonProps } = useButton(rest, ref); if (isEmbedded) { return (
); } return ( ); } interface VersionMismatchWarningProps { users: Set; room: Room; } export function VersionMismatchWarning({ users, room, }: VersionMismatchWarningProps) { const { modalState, modalProps } = useModalTriggerState(); const onDetailsClick = useCallback(() => { modalState.open(); }, [modalState]); if (users.size === 0) return null; return ( Incomaptible versions! {modalState.isOpen && ( )} ); }