2022-07-08 10:10:18 +03:00
|
|
|
import { useRecoilState, useRecoilValue } from 'recoil';
|
2023-01-10 10:58:41 +03:00
|
|
|
import { Skeleton } from 'antd';
|
2022-12-29 21:14:12 +03:00
|
|
|
import { FC, useEffect, useState } from 'react';
|
2022-10-04 07:06:46 +03:00
|
|
|
import dynamic from 'next/dynamic';
|
2022-06-27 09:01:52 +03:00
|
|
|
import { LOCAL_STORAGE_KEYS, getLocalStorage, setLocalStorage } from '../../../utils/localStorage';
|
2022-12-30 03:26:04 +03:00
|
|
|
import isPushNotificationSupported from '../../../utils/browserPushNotifications';
|
2022-06-27 09:01:52 +03:00
|
|
|
|
2022-05-04 00:17:05 +03:00
|
|
|
import {
|
|
|
|
clientConfigStateAtom,
|
2022-09-10 22:08:22 +03:00
|
|
|
chatMessagesAtom,
|
2022-10-11 02:26:09 +03:00
|
|
|
currentUserAtom,
|
2022-09-11 06:03:58 +03:00
|
|
|
isChatAvailableSelector,
|
2022-05-26 06:38:40 +03:00
|
|
|
isChatVisibleSelector,
|
|
|
|
appStateAtom,
|
|
|
|
isOnlineSelector,
|
2022-07-03 13:36:30 +03:00
|
|
|
isMobileAtom,
|
2022-07-13 00:10:59 +03:00
|
|
|
serverStatusState,
|
2022-05-04 00:17:05 +03:00
|
|
|
} from '../../stores/ClientConfigStore';
|
2022-04-28 19:54:33 +03:00
|
|
|
import { ClientConfig } from '../../../interfaces/client-config.model';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { CustomPageContent } from '../CustomPageContent/CustomPageContent';
|
2022-10-28 09:20:06 +03:00
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
import styles from './Content.module.scss';
|
|
|
|
import { Sidebar } from '../Sidebar/Sidebar';
|
|
|
|
import { Footer } from '../Footer/Footer';
|
2022-09-10 09:23:24 +03:00
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
import { ActionButtonRow } from '../../action-buttons/ActionButtonRow/ActionButtonRow';
|
|
|
|
import { ActionButton } from '../../action-buttons/ActionButton/ActionButton';
|
|
|
|
import { OfflineBanner } from '../OfflineBanner/OfflineBanner';
|
2022-05-26 06:38:40 +03:00
|
|
|
import { AppStateOptions } from '../../stores/application-state';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { FollowButton } from '../../action-buttons/FollowButton';
|
|
|
|
import { NotifyButton } from '../../action-buttons/NotifyButton';
|
|
|
|
import { ContentHeader } from '../../common/ContentHeader/ContentHeader';
|
2022-07-13 00:10:59 +03:00
|
|
|
import { ServerStatus } from '../../../interfaces/server-status.model';
|
2022-09-07 10:00:28 +03:00
|
|
|
import { Statusbar } from '../Statusbar/Statusbar';
|
2022-09-10 22:08:22 +03:00
|
|
|
import { ChatMessage } from '../../../interfaces/chat-message.model';
|
2022-10-22 08:24:29 +03:00
|
|
|
import { ExternalAction } from '../../../interfaces/external-action';
|
|
|
|
import { Modal } from '../Modal/Modal';
|
2022-10-22 09:58:39 +03:00
|
|
|
import { ActionButtonMenu } from '../../action-buttons/ActionButtonMenu/ActionButtonMenu';
|
2022-04-29 00:36:05 +03:00
|
|
|
|
2022-10-28 09:20:06 +03:00
|
|
|
// Lazy loaded components
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const FollowerCollection = dynamic(
|
|
|
|
() =>
|
|
|
|
import('../followers/FollowerCollection/FollowerCollection').then(
|
|
|
|
mod => mod.FollowerCollection,
|
|
|
|
),
|
|
|
|
{
|
|
|
|
ssr: false,
|
|
|
|
},
|
2023-01-09 11:53:28 +03:00
|
|
|
);
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const FollowModal = dynamic(
|
|
|
|
() => import('../../modals/FollowModal/FollowModal').then(mod => mod.FollowModal),
|
|
|
|
{
|
|
|
|
ssr: false,
|
|
|
|
},
|
2023-01-09 11:53:28 +03:00
|
|
|
);
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const BrowserNotifyModal = dynamic(
|
|
|
|
() =>
|
|
|
|
import('../../modals/BrowserNotifyModal/BrowserNotifyModal').then(
|
|
|
|
mod => mod.BrowserNotifyModal,
|
|
|
|
),
|
|
|
|
{
|
|
|
|
ssr: false,
|
|
|
|
},
|
2022-10-04 07:06:46 +03:00
|
|
|
);
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const NotifyReminderPopup = dynamic(
|
|
|
|
() => import('../NotifyReminderPopup/NotifyReminderPopup').then(mod => mod.NotifyReminderPopup),
|
|
|
|
{
|
|
|
|
ssr: false,
|
|
|
|
},
|
2022-10-04 07:06:46 +03:00
|
|
|
);
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const OwncastPlayer = dynamic(
|
|
|
|
() => import('../../video/OwncastPlayer/OwncastPlayer').then(mod => mod.OwncastPlayer),
|
|
|
|
{
|
|
|
|
ssr: false,
|
|
|
|
},
|
2022-10-28 09:20:06 +03:00
|
|
|
);
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const ChatContainer = dynamic(
|
|
|
|
() => import('../../chat/ChatContainer/ChatContainer').then(mod => mod.ChatContainer),
|
|
|
|
{
|
|
|
|
ssr: false,
|
|
|
|
},
|
2022-10-04 07:06:46 +03:00
|
|
|
);
|
|
|
|
|
2023-01-10 10:58:41 +03:00
|
|
|
const Tabs = dynamic(() => import('antd').then(mod => mod.Tabs), {
|
|
|
|
ssr: false,
|
|
|
|
});
|
|
|
|
|
2022-11-18 08:30:57 +03:00
|
|
|
const DesktopContent = ({
|
|
|
|
name,
|
|
|
|
streamTitle,
|
|
|
|
summary,
|
|
|
|
tags,
|
|
|
|
socialHandles,
|
|
|
|
extraPageContent,
|
|
|
|
setShowFollowModal,
|
2022-12-30 03:26:04 +03:00
|
|
|
supportFediverseFeatures,
|
2022-11-18 08:30:57 +03:00
|
|
|
}) => {
|
2022-10-11 03:53:14 +03:00
|
|
|
const aboutTabContent = <CustomPageContent content={extraPageContent} />;
|
2022-11-18 08:30:57 +03:00
|
|
|
const followersTabContent = (
|
2023-01-13 11:28:05 +03:00
|
|
|
<div style={{ minHeight: '16vh' }}>
|
2023-01-12 05:56:10 +03:00
|
|
|
<FollowerCollection name={name} onFollowButtonClick={() => setShowFollowModal(true)} />
|
|
|
|
</div>
|
2022-11-18 08:30:57 +03:00
|
|
|
);
|
2022-09-10 22:08:22 +03:00
|
|
|
|
2022-12-30 03:26:04 +03:00
|
|
|
const items = [{ label: 'About', key: '2', children: aboutTabContent }];
|
|
|
|
if (supportFediverseFeatures) {
|
|
|
|
items.push({ label: 'Followers', key: '3', children: followersTabContent });
|
|
|
|
}
|
2022-10-11 03:53:14 +03:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
|
|
|
<div className={styles.lowerHalf}>
|
|
|
|
<ContentHeader
|
|
|
|
name={name}
|
|
|
|
title={streamTitle}
|
|
|
|
summary={summary}
|
|
|
|
tags={tags}
|
|
|
|
links={socialHandles}
|
|
|
|
logo="/logo"
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
<div className={styles.lowerSection}>
|
2022-12-30 03:26:04 +03:00
|
|
|
{items.length > 1 ? <Tabs defaultActiveKey="0" items={items} /> : aboutTabContent}
|
2022-10-11 03:53:14 +03:00
|
|
|
</div>
|
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|
2022-09-10 22:08:22 +03:00
|
|
|
|
|
|
|
const MobileContent = ({
|
|
|
|
name,
|
|
|
|
streamTitle,
|
|
|
|
summary,
|
|
|
|
tags,
|
|
|
|
socialHandles,
|
|
|
|
extraPageContent,
|
|
|
|
messages,
|
2022-10-11 04:33:15 +03:00
|
|
|
currentUser,
|
2022-09-11 06:03:58 +03:00
|
|
|
showChat,
|
2022-10-22 09:58:39 +03:00
|
|
|
actions,
|
|
|
|
setExternalActionToDisplay,
|
2022-10-24 07:59:25 +03:00
|
|
|
setShowNotifyPopup,
|
|
|
|
setShowFollowModal,
|
2022-12-30 03:26:04 +03:00
|
|
|
supportFediverseFeatures,
|
|
|
|
supportsBrowserNotifications,
|
2022-10-11 03:53:14 +03:00
|
|
|
}) => {
|
2022-10-11 04:33:15 +03:00
|
|
|
if (!currentUser) {
|
2023-01-11 03:39:12 +03:00
|
|
|
return <Skeleton loading active paragraph={{ rows: 7 }} />;
|
2022-10-11 04:33:15 +03:00
|
|
|
}
|
|
|
|
const { id, displayName } = currentUser;
|
|
|
|
|
2022-10-11 03:53:14 +03:00
|
|
|
const chatContent = showChat && (
|
|
|
|
<ChatContainer
|
|
|
|
messages={messages}
|
2022-10-11 04:33:15 +03:00
|
|
|
usernameToHighlight={displayName}
|
|
|
|
chatUserId={id}
|
2022-10-11 03:53:14 +03:00
|
|
|
isModerator={false}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
|
|
|
|
const aboutTabContent = (
|
|
|
|
<>
|
|
|
|
<ContentHeader
|
|
|
|
name={name}
|
|
|
|
title={streamTitle}
|
|
|
|
summary={summary}
|
|
|
|
tags={tags}
|
|
|
|
links={socialHandles}
|
|
|
|
logo="/logo"
|
|
|
|
/>
|
|
|
|
<CustomPageContent content={extraPageContent} />
|
|
|
|
</>
|
|
|
|
);
|
2022-11-18 08:30:57 +03:00
|
|
|
const followersTabContent = (
|
|
|
|
<FollowerCollection name={name} onFollowButtonClick={() => setShowFollowModal(true)} />
|
|
|
|
);
|
2022-10-11 03:53:14 +03:00
|
|
|
|
|
|
|
const items = [
|
2022-10-22 09:58:39 +03:00
|
|
|
showChat && { label: 'Chat', key: '0', children: chatContent },
|
2022-10-11 03:53:14 +03:00
|
|
|
{ label: 'About', key: '2', children: aboutTabContent },
|
|
|
|
{ label: 'Followers', key: '3', children: followersTabContent },
|
|
|
|
];
|
|
|
|
|
2022-10-22 09:58:39 +03:00
|
|
|
const replacementTabBar = (props, DefaultTabBar) => (
|
2023-01-16 05:37:21 +03:00
|
|
|
<div className={styles.replacementBar}>
|
|
|
|
<DefaultTabBar {...props} className={styles.defaultTabBar} />
|
2022-10-24 07:59:25 +03:00
|
|
|
<ActionButtonMenu
|
2023-01-16 05:37:21 +03:00
|
|
|
className={styles.actionButtonMenu}
|
2022-12-30 03:26:04 +03:00
|
|
|
showFollowItem={supportFediverseFeatures}
|
|
|
|
showNotifyItem={supportsBrowserNotifications}
|
2022-10-24 07:59:25 +03:00
|
|
|
actions={actions}
|
|
|
|
externalActionSelected={setExternalActionToDisplay}
|
|
|
|
notifyItemSelected={() => setShowNotifyPopup(true)}
|
|
|
|
followItemSelected={() => setShowFollowModal(true)}
|
|
|
|
/>
|
2022-10-22 09:58:39 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
|
2022-10-11 03:53:14 +03:00
|
|
|
return (
|
2022-12-29 21:14:12 +03:00
|
|
|
<div className={styles.lowerSectionMobile}>
|
|
|
|
<Tabs
|
|
|
|
className={styles.tabs}
|
|
|
|
defaultActiveKey="0"
|
|
|
|
items={items}
|
|
|
|
renderTabBar={replacementTabBar}
|
|
|
|
/>
|
2022-10-11 03:53:14 +03:00
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|
2022-09-10 22:08:22 +03:00
|
|
|
|
2022-10-22 08:24:29 +03:00
|
|
|
const ExternalModal = ({ externalActionToDisplay, setExternalActionToDisplay }) => {
|
|
|
|
const { title, description, url } = externalActionToDisplay;
|
|
|
|
return (
|
|
|
|
<Modal
|
|
|
|
title={description || title}
|
|
|
|
url={url}
|
|
|
|
open={!!externalActionToDisplay}
|
|
|
|
height="80vh"
|
|
|
|
handleCancel={() => setExternalActionToDisplay(null)}
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2022-09-07 10:00:28 +03:00
|
|
|
export const Content: FC = () => {
|
2022-05-26 06:38:40 +03:00
|
|
|
const appState = useRecoilValue<AppStateOptions>(appStateAtom);
|
2022-05-03 03:45:22 +03:00
|
|
|
const clientConfig = useRecoilValue<ClientConfig>(clientConfigStateAtom);
|
2022-05-26 06:38:40 +03:00
|
|
|
const isChatVisible = useRecoilValue<boolean>(isChatVisibleSelector);
|
2022-09-11 06:03:58 +03:00
|
|
|
const isChatAvailable = useRecoilValue<boolean>(isChatAvailableSelector);
|
2022-10-11 02:26:09 +03:00
|
|
|
const currentUser = useRecoilValue(currentUserAtom);
|
2022-09-11 06:03:58 +03:00
|
|
|
|
2022-07-08 10:10:18 +03:00
|
|
|
const [isMobile, setIsMobile] = useRecoilState<boolean | undefined>(isMobileAtom);
|
2022-09-10 22:08:22 +03:00
|
|
|
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom);
|
2022-05-26 06:38:40 +03:00
|
|
|
const online = useRecoilValue<boolean>(isOnlineSelector);
|
2022-10-11 02:26:09 +03:00
|
|
|
|
2022-08-17 03:49:21 +03:00
|
|
|
const { viewerCount, lastConnectTime, lastDisconnectTime, streamTitle } =
|
2022-07-13 00:10:59 +03:00
|
|
|
useRecoilValue<ServerStatus>(serverStatusState);
|
2022-08-17 03:49:21 +03:00
|
|
|
const {
|
|
|
|
extraPageContent,
|
|
|
|
version,
|
|
|
|
name,
|
|
|
|
summary,
|
|
|
|
socialHandles,
|
|
|
|
tags,
|
|
|
|
externalActions,
|
|
|
|
offlineMessage,
|
2022-09-11 06:03:58 +03:00
|
|
|
chatDisabled,
|
2022-10-09 01:05:52 +03:00
|
|
|
federation,
|
|
|
|
notifications,
|
2022-08-17 03:49:21 +03:00
|
|
|
} = clientConfig;
|
2022-06-27 09:01:52 +03:00
|
|
|
const [showNotifyReminder, setShowNotifyReminder] = useState(false);
|
2022-10-24 07:59:25 +03:00
|
|
|
const [showNotifyModal, setShowNotifyModal] = useState(false);
|
|
|
|
const [showFollowModal, setShowFollowModal] = useState(false);
|
2022-12-30 03:26:04 +03:00
|
|
|
const { account: fediverseAccount, enabled: fediverseEnabled } = federation;
|
2022-10-09 01:05:52 +03:00
|
|
|
const { browser: browserNotifications } = notifications;
|
|
|
|
const { enabled: browserNotificationsEnabled } = browserNotifications;
|
2022-10-22 08:24:29 +03:00
|
|
|
const [externalActionToDisplay, setExternalActionToDisplay] = useState<ExternalAction>(null);
|
|
|
|
|
2022-12-30 03:26:04 +03:00
|
|
|
const [supportsBrowserNotifications, setSupportsBrowserNotifications] = useState(false);
|
|
|
|
const supportFediverseFeatures = fediverseEnabled;
|
|
|
|
|
2022-10-22 08:24:29 +03:00
|
|
|
const externalActionSelected = (action: ExternalAction) => {
|
|
|
|
const { openExternally, url } = action;
|
|
|
|
if (openExternally) {
|
|
|
|
window.open(url, '_blank');
|
|
|
|
} else {
|
|
|
|
setExternalActionToDisplay(action);
|
|
|
|
}
|
|
|
|
};
|
2022-04-28 19:54:33 +03:00
|
|
|
|
2022-05-08 02:13:06 +03:00
|
|
|
const externalActionButtons = externalActions.map(action => (
|
2022-10-22 08:24:29 +03:00
|
|
|
<ActionButton
|
|
|
|
key={action.url}
|
|
|
|
action={action}
|
|
|
|
externalActionSelected={externalActionSelected}
|
|
|
|
/>
|
2022-05-08 02:13:06 +03:00
|
|
|
));
|
|
|
|
|
2022-06-27 09:01:52 +03:00
|
|
|
const incrementVisitCounter = () => {
|
|
|
|
let visits = parseInt(getLocalStorage(LOCAL_STORAGE_KEYS.userVisitCount), 10);
|
|
|
|
if (Number.isNaN(visits)) {
|
|
|
|
visits = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
setLocalStorage(LOCAL_STORAGE_KEYS.userVisitCount, visits + 1);
|
|
|
|
|
|
|
|
if (visits > 2 && !getLocalStorage(LOCAL_STORAGE_KEYS.hasDisplayedNotificationModal)) {
|
|
|
|
setShowNotifyReminder(true);
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
const disableNotifyReminderPopup = () => {
|
2022-10-24 07:59:25 +03:00
|
|
|
setShowNotifyModal(false);
|
2022-06-27 09:01:52 +03:00
|
|
|
setShowNotifyReminder(false);
|
|
|
|
setLocalStorage(LOCAL_STORAGE_KEYS.hasDisplayedNotificationModal, true);
|
|
|
|
};
|
|
|
|
|
2022-07-03 13:36:30 +03:00
|
|
|
const checkIfMobile = () => {
|
|
|
|
const w = window.innerWidth;
|
|
|
|
if (isMobile === undefined) {
|
|
|
|
if (w <= 768) setIsMobile(true);
|
|
|
|
else setIsMobile(false);
|
|
|
|
}
|
|
|
|
if (!isMobile && w <= 768) setIsMobile(true);
|
|
|
|
if (isMobile && w > 768) setIsMobile(false);
|
|
|
|
};
|
|
|
|
|
2022-06-27 09:01:52 +03:00
|
|
|
useEffect(() => {
|
|
|
|
incrementVisitCounter();
|
2022-07-03 13:36:30 +03:00
|
|
|
checkIfMobile();
|
|
|
|
window.addEventListener('resize', checkIfMobile);
|
2022-10-22 08:24:29 +03:00
|
|
|
return () => {
|
|
|
|
window.removeEventListener('resize', checkIfMobile);
|
|
|
|
};
|
2022-06-27 09:01:52 +03:00
|
|
|
}, []);
|
|
|
|
|
2022-12-30 03:26:04 +03:00
|
|
|
useEffect(() => {
|
|
|
|
// isPushNotificationSupported relies on `navigator` so that needs to be
|
|
|
|
// fired from this useEffect.
|
|
|
|
setSupportsBrowserNotifications(isPushNotificationSupported() && browserNotificationsEnabled);
|
|
|
|
}, [browserNotificationsEnabled]);
|
|
|
|
|
2022-09-11 06:03:58 +03:00
|
|
|
const showChat = !chatDisabled && isChatAvailable && isChatVisible;
|
2022-09-11 04:08:51 +03:00
|
|
|
|
2022-04-28 19:54:33 +03:00
|
|
|
return (
|
2022-10-22 08:24:29 +03:00
|
|
|
<>
|
|
|
|
<div className={styles.main}>
|
2023-01-10 10:58:41 +03:00
|
|
|
<div className={styles.root}>
|
2022-12-13 06:10:49 +03:00
|
|
|
<div className={styles.mainSection}>
|
|
|
|
<div className={styles.topSection}>
|
|
|
|
{appState.appLoading && <Skeleton loading active paragraph={{ rows: 7 }} />}
|
|
|
|
{online && <OwncastPlayer source="/hls/stream.m3u8" online={online} />}
|
|
|
|
{!online && !appState.appLoading && (
|
|
|
|
<OfflineBanner
|
|
|
|
streamName={name}
|
|
|
|
customText={offlineMessage}
|
|
|
|
notificationsEnabled={browserNotificationsEnabled}
|
|
|
|
fediverseAccount={fediverseAccount}
|
|
|
|
lastLive={lastDisconnectTime}
|
|
|
|
onNotifyClick={() => setShowNotifyModal(true)}
|
|
|
|
onFollowClick={() => setShowFollowModal(true)}
|
2022-10-09 01:05:52 +03:00
|
|
|
/>
|
2022-12-13 06:10:49 +03:00
|
|
|
)}
|
|
|
|
{online && (
|
|
|
|
<Statusbar
|
|
|
|
online={online}
|
|
|
|
lastConnectTime={lastConnectTime}
|
|
|
|
lastDisconnectTime={lastDisconnectTime}
|
|
|
|
viewerCount={viewerCount}
|
2022-10-09 04:53:41 +03:00
|
|
|
/>
|
|
|
|
)}
|
2022-09-11 04:08:51 +03:00
|
|
|
</div>
|
2022-12-13 06:10:49 +03:00
|
|
|
<div className={styles.midSection}>
|
|
|
|
<div className={styles.buttonsLogoTitleSection}>
|
|
|
|
{!isMobile && (
|
|
|
|
<ActionButtonRow>
|
|
|
|
{externalActionButtons}
|
2022-12-30 03:26:04 +03:00
|
|
|
{supportFediverseFeatures && (
|
|
|
|
<FollowButton size="small" onClick={() => setShowFollowModal(true)} />
|
|
|
|
)}
|
|
|
|
{supportsBrowserNotifications && (
|
|
|
|
<NotifyReminderPopup
|
|
|
|
open={showNotifyReminder}
|
|
|
|
notificationClicked={() => setShowNotifyModal(true)}
|
|
|
|
notificationClosed={() => disableNotifyReminderPopup()}
|
|
|
|
>
|
|
|
|
<NotifyButton onClick={() => setShowNotifyModal(true)} />
|
|
|
|
</NotifyReminderPopup>
|
|
|
|
)}
|
2022-12-13 06:10:49 +03:00
|
|
|
</ActionButtonRow>
|
|
|
|
)}
|
|
|
|
|
|
|
|
<Modal
|
|
|
|
title="Browser Notifications"
|
|
|
|
open={showNotifyModal}
|
|
|
|
afterClose={() => disableNotifyReminderPopup()}
|
|
|
|
handleCancel={() => disableNotifyReminderPopup()}
|
|
|
|
>
|
|
|
|
<BrowserNotifyModal />
|
|
|
|
</Modal>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
{isMobile ? (
|
|
|
|
<MobileContent
|
|
|
|
name={name}
|
|
|
|
streamTitle={streamTitle}
|
|
|
|
summary={summary}
|
|
|
|
tags={tags}
|
|
|
|
socialHandles={socialHandles}
|
|
|
|
extraPageContent={extraPageContent}
|
|
|
|
messages={messages}
|
|
|
|
currentUser={currentUser}
|
|
|
|
showChat={showChat}
|
|
|
|
actions={externalActions}
|
|
|
|
setExternalActionToDisplay={externalActionSelected}
|
|
|
|
setShowNotifyPopup={setShowNotifyModal}
|
|
|
|
setShowFollowModal={setShowFollowModal}
|
2022-12-30 03:26:04 +03:00
|
|
|
supportFediverseFeatures={supportFediverseFeatures}
|
|
|
|
supportsBrowserNotifications={supportsBrowserNotifications}
|
2022-12-13 06:10:49 +03:00
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
<DesktopContent
|
|
|
|
name={name}
|
|
|
|
streamTitle={streamTitle}
|
|
|
|
summary={summary}
|
|
|
|
tags={tags}
|
|
|
|
socialHandles={socialHandles}
|
|
|
|
extraPageContent={extraPageContent}
|
|
|
|
setShowFollowModal={setShowFollowModal}
|
2022-12-30 03:26:04 +03:00
|
|
|
supportFediverseFeatures={supportFediverseFeatures}
|
2022-12-13 06:10:49 +03:00
|
|
|
/>
|
|
|
|
)}
|
2023-01-12 05:56:10 +03:00
|
|
|
{!isMobile && <Footer version={version} />}
|
2022-12-13 06:10:49 +03:00
|
|
|
</div>
|
|
|
|
{showChat && !isMobile && <Sidebar />}
|
2023-01-10 10:58:41 +03:00
|
|
|
</div>
|
2022-10-22 08:24:29 +03:00
|
|
|
</div>
|
|
|
|
{externalActionToDisplay && (
|
|
|
|
<ExternalModal
|
|
|
|
externalActionToDisplay={externalActionToDisplay}
|
|
|
|
setExternalActionToDisplay={setExternalActionToDisplay}
|
|
|
|
/>
|
|
|
|
)}
|
2022-10-24 07:59:25 +03:00
|
|
|
<Modal
|
|
|
|
title={`Follow ${name}`}
|
|
|
|
open={showFollowModal}
|
|
|
|
handleCancel={() => setShowFollowModal(false)}
|
|
|
|
width="550px"
|
|
|
|
>
|
|
|
|
<FollowModal
|
|
|
|
account={fediverseAccount}
|
|
|
|
name={name}
|
|
|
|
handleClose={() => setShowFollowModal(false)}
|
|
|
|
/>
|
|
|
|
</Modal>
|
2022-10-22 08:24:29 +03:00
|
|
|
</>
|
2022-04-28 19:54:33 +03:00
|
|
|
);
|
2022-09-07 10:00:28 +03:00
|
|
|
};
|
|
|
|
export default Content;
|