0

78 lines
2.7 KiB
TypeScript
Raw Normal View History

import { useRecoilValue } from 'recoil';
import { Layout, Row, Col, Tabs } from 'antd';
2022-05-03 14:17:05 -07:00
import Grid from 'antd/lib/card/Grid';
import {
chatVisibilityAtom,
clientConfigStateAtom,
chatMessagesAtom,
chatStateAtom,
} from '../../stores/ClientConfigStore';
import { ClientConfig } from '../../../interfaces/client-config.model';
import CustomPageContent from '../../CustomPageContent';
import OwncastPlayer from '../../video/OwncastPlayer';
import FollowerCollection from '../../FollowersCollection';
2022-05-03 23:55:13 +02:00
import s from './Content.module.scss';
import Sidebar from '../Sidebar';
import Footer from '../Footer';
import ChatContainer from '../../chat/ChatContainer';
import { ChatMessage } from '../../../interfaces/chat-message.model';
import { ChatState, ChatVisibilityState } from '../../../interfaces/application-state';
import ChatTextField from '../../chat/ChatTextField/ChatTextField';
2022-05-05 15:01:23 -07:00
import ExternalActionButtonRow from '../../action-buttons/ExternalActionButtonRow';
const { TabPane } = Tabs;
const { Content } = Layout;
export default function FooterComponent() {
const clientConfig = useRecoilValue<ClientConfig>(clientConfigStateAtom);
2022-05-03 23:55:13 +02:00
const chatOpen = useRecoilValue<ChatVisibilityState>(chatVisibilityAtom);
const messages = useRecoilValue<ChatMessage[]>(chatMessagesAtom);
const chatState = useRecoilValue<ChatState>(chatStateAtom);
const { extraPageContent } = clientConfig;
2022-05-03 14:17:05 -07:00
const followers: Follower[] = [];
const total = 0;
return (
<Content className={`${s.root}`} data-columns={chatOpen ? 2 : 1}>
<div className={`${s.leftCol}`}>
2022-05-03 23:55:13 +02:00
<OwncastPlayer source="https://watch.owncast.online" />
2022-05-05 15:01:23 -07:00
<ExternalActionButtonRow
actions={[
{
url: 'https://owncast.online/docs',
title: 'Example button',
description: 'Example button description',
icon: 'https://owncast.online/images/logo.svg',
color: '#5232c8',
openExternally: true,
},
]}
/>
2022-05-03 23:55:13 +02:00
<div className={`${s.lowerRow}`}>
<Tabs defaultActiveKey="1" type="card">
<TabPane tab="About" key="1" className={`${s.pageContentSection}`}>
2022-05-03 23:55:13 +02:00
<CustomPageContent content={extraPageContent} />
</TabPane>
<TabPane tab="Followers" key="2" className={`${s.pageContentSection}`}>
2022-05-03 14:17:05 -07:00
<FollowerCollection total={total} followers={followers} />
2022-05-03 23:55:13 +02:00
</TabPane>
</Tabs>
{chatOpen && (
<div className={`${s.mobileChat}`}>
<ChatContainer messages={messages} state={chatState} />
<ChatTextField />
</div>
)}
2022-05-03 23:55:13 +02:00
<Footer />
</div>
</div>
{chatOpen && <Sidebar />}
</Content>
);
}