diff --git a/tgui/packages/tgui-panel/Notifications.js b/tgui/packages/tgui-panel/Notifications.js deleted file mode 100644 index a64ddd8e306..00000000000 --- a/tgui/packages/tgui-panel/Notifications.js +++ /dev/null @@ -1,41 +0,0 @@ -/** - * @file - * @copyright 2020 Aleksej Komarov - * @license MIT - */ - -import { Flex } from 'tgui/components'; - -export const Notifications = props => { - const { children } = props; - return ( -
- {children} -
- ); -}; - -const NotificationsItem = props => { - const { - rightSlot, - children, - } = props; - return ( - - - {children} - - {rightSlot && ( - - {rightSlot} - - )} - - ); -}; - -Notifications.Item = NotificationsItem; diff --git a/tgui/packages/tgui-panel/Panel.js b/tgui/packages/tgui-panel/Panel.js deleted file mode 100644 index d6cc9eb7efc..00000000000 --- a/tgui/packages/tgui-panel/Panel.js +++ /dev/null @@ -1,138 +0,0 @@ -/** - * @file - * @copyright 2020 Aleksej Komarov - * @license MIT - */ - -import { Button, Section, Stack } from 'tgui/components'; -import { Pane } from 'tgui/layouts'; -import { NowPlayingWidget, useAudio } from './audio'; -import { ChatPanel, ChatTabs } from './chat'; -import { useGame } from './game'; -import { Notifications } from './Notifications'; -import { PingIndicator } from './ping'; -import { SettingsPanel, useSettings } from './settings'; - -export const Panel = (props, context) => { - // IE8-10: Needs special treatment due to missing Flex support - if (Byond.IS_LTE_IE10) { - return ( - - ); - } - const audio = useAudio(context); - const settings = useSettings(context); - const game = useGame(context); - if (process.env.NODE_ENV !== 'production') { - const { useDebug, KitchenSink } = require('tgui/debug'); - const debug = useDebug(context); - if (debug.kitchenSink) { - return ( - - ); - } - } - return ( - - - -
- - - - - - - - -
-
- {audio.visible && ( - -
- -
-
- )} - {settings.visible && ( - - - - )} - -
- - - - - {game.connectionLostAt && ( - Byond.command('.reconnect')}> - Reconnect - - )}> - You are either AFK, experiencing lag or the connection - has closed. - - )} - {game.roundRestartedAt && ( - - The connection has been closed because the server is - restarting. Please wait while you automatically reconnect. - - )} - -
-
-
-
- ); -}; - -const HoboPanel = (props, context) => { - const settings = useSettings(context); - return ( - - - - {settings.visible && ( - - ) || ( - - )} - - - ); -}; diff --git a/tgui/packages/tgui-panel/audio/NowPlayingWidget.js b/tgui/packages/tgui-panel/audio/NowPlayingWidget.js deleted file mode 100644 index e4fe04eed16..00000000000 --- a/tgui/packages/tgui-panel/audio/NowPlayingWidget.js +++ /dev/null @@ -1,68 +0,0 @@ -/** - * @file - * @copyright 2020 Aleksej Komarov - * @license MIT - */ - -import { toFixed } from 'common/math'; -import { useDispatch, useSelector } from 'common/redux'; -import { Button, Flex, Knob } from 'tgui/components'; -import { useSettings } from '../settings'; -import { selectAudio } from './selectors'; - -export const NowPlayingWidget = (props, context) => { - const audio = useSelector(context, selectAudio); - const dispatch = useDispatch(context); - const settings = useSettings(context); - const title = audio.meta?.title; - return ( - - {audio.playing && ( - <> - - Now playing: - - - {title || 'Unknown Track'} - - - ) || ( - - Nothing to play. - - )} - {audio.playing && ( - - - - - -
- {MESSAGE_TYPES - .filter(typeDef => !typeDef.important && !typeDef.admin) - .map(typeDef => ( - dispatch(toggleAcceptedType({ - pageId: page.id, - type: typeDef.type, - }))}> - {typeDef.name} - - ))} - - {MESSAGE_TYPES - .filter(typeDef => !typeDef.important && typeDef.admin) - .map(typeDef => ( - dispatch(toggleAcceptedType({ - pageId: page.id, - type: typeDef.type, - }))}> - {typeDef.name} - - ))} - -
- - ); -}; diff --git a/tgui/packages/tgui-panel/chat/ChatPanel.js b/tgui/packages/tgui-panel/chat/ChatPanel.js deleted file mode 100644 index 0a5deaf9feb..00000000000 --- a/tgui/packages/tgui-panel/chat/ChatPanel.js +++ /dev/null @@ -1,71 +0,0 @@ -/** - * @file - * @copyright 2020 Aleksej Komarov - * @license MIT - */ - -import { shallowDiffers } from 'common/react'; -import { Component, createRef } from 'inferno'; -import { Button } from 'tgui/components'; -import { chatRenderer } from './renderer'; - -export class ChatPanel extends Component { - constructor() { - super(); - this.ref = createRef(); - this.state = { - scrollTracking: true, - }; - this.handleScrollTrackingChange = value => this.setState({ - scrollTracking: value, - }); - } - - componentDidMount() { - chatRenderer.mount(this.ref.current); - chatRenderer.events.on('scrollTrackingChanged', - this.handleScrollTrackingChange); - this.componentDidUpdate(); - } - - componentWillUnmount() { - chatRenderer.events.off('scrollTrackingChanged', - this.handleScrollTrackingChange); - } - - componentDidUpdate(prevProps) { - requestAnimationFrame(() => { - chatRenderer.ensureScrollTracking(); - }); - const shouldUpdateStyle = ( - !prevProps || shallowDiffers(this.props, prevProps) - ); - if (shouldUpdateStyle) { - chatRenderer.assignStyle({ - 'width': '100%', - 'white-space': 'pre-wrap', - 'font-size': this.props.fontSize, - 'line-height': this.props.lineHeight, - }); - } - } - - render() { - const { - scrollTracking, - } = this.state; - return ( - <> -
- {!scrollTracking && ( - - )} - - ); - } -} diff --git a/tgui/packages/tgui-panel/chat/ChatTabs.js b/tgui/packages/tgui-panel/chat/ChatTabs.js deleted file mode 100644 index a0e6cc59e52..00000000000 --- a/tgui/packages/tgui-panel/chat/ChatTabs.js +++ /dev/null @@ -1,61 +0,0 @@ -/** - * @file - * @copyright 2020 Aleksej Komarov - * @license MIT - */ - -import { useDispatch, useSelector } from 'common/redux'; -import { Box, Tabs, Flex, Button } from 'tgui/components'; -import { changeChatPage, addChatPage } from './actions'; -import { selectChatPages, selectCurrentChatPage } from './selectors'; -import { openChatSettings } from '../settings/actions'; - -const UnreadCountWidget = ({ value }) => ( - - {Math.min(value, 99)} - -); - -export const ChatTabs = (props, context) => { - const pages = useSelector(context, selectChatPages); - const currentPage = useSelector(context, selectCurrentChatPage); - const dispatch = useDispatch(context); - return ( - - - - {pages.map(page => ( - 0 && ( - - )} - onClick={() => dispatch(changeChatPage({ - pageId: page.id, - }))}> - {page.name} - - ))} - - - -