diff --git a/tgui/package.json b/tgui/package.json index 3aa94299c4..a3bdcb4d90 100644 --- a/tgui/package.json +++ b/tgui/package.json @@ -28,7 +28,7 @@ "@babel/preset-typescript": "^7.17.12", "@types/jest": "^27.5.1", "@types/jsdom": "^16.2.14", - "@types/node": "^17.0.35", + "@types/node": "^14.x", "@types/webpack": "^5.28.0", "@types/webpack-env": "^1.17.0", "@typescript-eslint/parser": "^5.25.0", diff --git a/tgui/packages/common/redux.ts b/tgui/packages/common/redux.ts index 4e618bddaf..1635853c6b 100644 --- a/tgui/packages/common/redux.ts +++ b/tgui/packages/common/redux.ts @@ -201,12 +201,16 @@ export const createAction = ( export const useDispatch = (context: { store: Store; }): Dispatch => { - return context.store.dispatch; + return context?.store?.dispatch; }; export const useSelector = ( context: { store: Store }, selector: (state: State) => Selected ): Selected => { - return selector(context.store.getState()); + if (!context) { + return {} as Selected; + } + + return selector(context?.store?.getState()); }; diff --git a/tgui/packages/tgui-panel/Notifications.jsx b/tgui/packages/tgui-panel/Notifications.tsx similarity index 100% rename from tgui/packages/tgui-panel/Notifications.jsx rename to tgui/packages/tgui-panel/Notifications.tsx diff --git a/tgui/packages/tgui-panel/Panel.jsx b/tgui/packages/tgui-panel/Panel.tsx similarity index 82% rename from tgui/packages/tgui-panel/Panel.jsx rename to tgui/packages/tgui-panel/Panel.tsx index 0e412c97de..8171333866 100644 --- a/tgui/packages/tgui-panel/Panel.jsx +++ b/tgui/packages/tgui-panel/Panel.tsx @@ -15,10 +15,6 @@ import { ReconnectButton } from './reconnect'; 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); @@ -29,6 +25,7 @@ export const Panel = (props, context) => { return ; } } + return ( @@ -104,27 +101,3 @@ export const Panel = (props, context) => { ); }; - -const HoboPanel = (props, context) => { - const settings = useSettings(context); - return ( - - - - {(settings.visible && ) || ( - - )} - - - ); -}; diff --git a/tgui/packages/tgui-panel/audio/hooks.js b/tgui/packages/tgui-panel/audio/hooks.ts similarity index 100% rename from tgui/packages/tgui-panel/audio/hooks.js rename to tgui/packages/tgui-panel/audio/hooks.ts diff --git a/tgui/packages/tgui-panel/audio/player.js b/tgui/packages/tgui-panel/audio/player.js index f9dfa41cef..50eccee16b 100644 --- a/tgui/packages/tgui-panel/audio/player.js +++ b/tgui/packages/tgui-panel/audio/player.js @@ -10,10 +10,6 @@ const logger = createLogger('AudioPlayer'); export class AudioPlayer { constructor() { - // Doesn't support HTMLAudioElement - if (Byond.IS_LTE_IE9) { - return; - } // Set up the HTMLAudioElement node this.node = document.createElement('audio'); this.node.style.setProperty('display', 'none'); diff --git a/tgui/packages/tgui-panel/audio/reducer.js b/tgui/packages/tgui-panel/audio/reducer.ts similarity index 100% rename from tgui/packages/tgui-panel/audio/reducer.js rename to tgui/packages/tgui-panel/audio/reducer.ts diff --git a/tgui/packages/tgui-panel/audio/selectors.js b/tgui/packages/tgui-panel/audio/selectors.ts similarity index 100% rename from tgui/packages/tgui-panel/audio/selectors.js rename to tgui/packages/tgui-panel/audio/selectors.ts diff --git a/tgui/packages/tgui-panel/chat/renderer.js b/tgui/packages/tgui-panel/chat/renderer.jsx similarity index 97% rename from tgui/packages/tgui-panel/chat/renderer.js rename to tgui/packages/tgui-panel/chat/renderer.jsx index ca58f45956..3b060548bb 100644 --- a/tgui/packages/tgui-panel/chat/renderer.js +++ b/tgui/packages/tgui-panel/chat/renderer.jsx @@ -532,11 +532,13 @@ class ChatRenderer { if (!message.type) { // IE8: Does not support querySelector on elements that // are not yet in the document. - // prettier-ignore - const typeDef = !Byond.IS_LTE_IE8 && MESSAGE_TYPES - .find(typeDef => ( - typeDef.selector && node.querySelector(typeDef.selector) - )); + + const typeDef = + !Byond.IS_LTE_IE8 && + MESSAGE_TYPES.find( + (typeDef) => + typeDef.selector && node.querySelector(typeDef.selector) + ); message.type = typeDef?.type || MESSAGE_TYPE_UNKNOWN; } updateMessageBadge(message); @@ -594,10 +596,10 @@ class ChatRenderer { message.node = 'pruned'; } // Remove pruned messages from the message array - // prettier-ignore - this.messages = this.messages.filter(message => ( - message.node !== 'pruned' - )); + + this.messages = this.messages.filter( + (message) => message.node !== 'pruned' + ); logger.log(`pruned ${fromIndex} visible messages`); } } @@ -674,19 +676,22 @@ class ChatRenderer { // } } // Create a page - // prettier-ignore - const pageHtml = '\n' - + '\n' - + '\n' - + 'SS13 Chat Log\n' - + '\n' - + '\n' - + '\n' - + '
\n' - + messagesHtml - + '
\n' - + '\n' - + '\n'; + + const pageHtml = + '\n' + + '\n' + + '\n' + + 'SS13 Chat Log\n' + + '\n' + + '\n' + + '\n' + + '
\n' + + messagesHtml + + '
\n' + + '\n' + + '\n'; // Create and send a nice blob const blob = new Blob([pageHtml]); const timestamp = new Date() diff --git a/tgui/packages/tgui-panel/chat/replaceInTextNode.js b/tgui/packages/tgui-panel/chat/replaceInTextNode.js index 753997b3b8..5c345e90a1 100644 --- a/tgui/packages/tgui-panel/chat/replaceInTextNode.js +++ b/tgui/packages/tgui-panel/chat/replaceInTextNode.js @@ -171,8 +171,8 @@ export const highlightNode = ( // Linkify // -------------------------------------------------------- -// prettier-ignore -const URL_REGEX = /(?:(?:https?:\/\/)|(?:www\.))(?:[^ ]*?\.[^ ]*?)+[-A-Za-z0-9+&@#/%?=~_|$!:,.;(){}]+/ig; +const URL_REGEX = + /(?:(?:https?:\/\/)|(?:www\.))(?:[^ ]*?\.[^ ]*?)+[-A-Za-z0-9+&@#/%?=~_|$!:,.;(){}]+/gi; /** * Highlights the text in the node based on the provided regular expression. diff --git a/tgui/packages/tgui-panel/chat/selectors.js b/tgui/packages/tgui-panel/chat/selectors.ts similarity index 85% rename from tgui/packages/tgui-panel/chat/selectors.js rename to tgui/packages/tgui-panel/chat/selectors.ts index 6352b7cddf..2908f66126 100644 --- a/tgui/packages/tgui-panel/chat/selectors.js +++ b/tgui/packages/tgui-panel/chat/selectors.ts @@ -9,7 +9,7 @@ import { map } from 'common/collections'; export const selectChat = (state) => state.chat; export const selectChatPages = (state) => - map((id) => state.chat.pageById[id])(state.chat.pages); + map((id: string) => state.chat.pageById[id])(state.chat.pages); export const selectCurrentChatPage = (state) => state.chat.pageById[state.chat.currentPageId]; diff --git a/tgui/packages/tgui-panel/game/actions.js b/tgui/packages/tgui-panel/game/actions.ts similarity index 100% rename from tgui/packages/tgui-panel/game/actions.js rename to tgui/packages/tgui-panel/game/actions.ts diff --git a/tgui/packages/tgui-panel/game/hooks.js b/tgui/packages/tgui-panel/game/hooks.ts similarity index 100% rename from tgui/packages/tgui-panel/game/hooks.js rename to tgui/packages/tgui-panel/game/hooks.ts diff --git a/tgui/packages/tgui-panel/game/reducer.js b/tgui/packages/tgui-panel/game/reducer.ts similarity index 95% rename from tgui/packages/tgui-panel/game/reducer.js rename to tgui/packages/tgui-panel/game/reducer.ts index 5749ae96b1..965bfa0cb7 100644 --- a/tgui/packages/tgui-panel/game/reducer.js +++ b/tgui/packages/tgui-panel/game/reducer.ts @@ -17,7 +17,7 @@ const initialState = { }; export const gameReducer = (state = initialState, action) => { - const { type, payload, meta } = action; + const { type, meta } = action; if (type === 'roundrestart') { return { ...state, diff --git a/tgui/packages/tgui-panel/game/selectors.js b/tgui/packages/tgui-panel/game/selectors.ts similarity index 100% rename from tgui/packages/tgui-panel/game/selectors.js rename to tgui/packages/tgui-panel/game/selectors.ts diff --git a/tgui/packages/tgui-panel/index.js b/tgui/packages/tgui-panel/index.tsx similarity index 86% rename from tgui/packages/tgui-panel/index.js rename to tgui/packages/tgui-panel/index.tsx index adf5749001..2c5ef175a8 100644 --- a/tgui/packages/tgui-panel/index.js +++ b/tgui/packages/tgui-panel/index.tsx @@ -23,6 +23,7 @@ import { setupPanelFocusHacks } from './panelFocus'; import { pingMiddleware, pingReducer } from './ping'; import { settingsMiddleware, settingsReducer } from './settings'; import { telemetryMiddleware } from './telemetry'; +import { setGlobalStore } from 'tgui/backend'; perf.mark('inception', window.performance?.timing?.navigationStart); perf.mark('init'); @@ -48,6 +49,8 @@ const store = configureStore({ }); const renderApp = createRenderer(() => { + setGlobalStore(store); + const { Panel } = require('./Panel'); return ( @@ -87,7 +90,7 @@ const setupApp = () => { }); // Resize the panel to match the non-browser output - Byond.winget('output').then((output) => { + Byond.winget('output').then((output: { size: string }) => { Byond.winset('browseroutput', { 'size': output.size, }); @@ -96,19 +99,22 @@ const setupApp = () => { // Enable hot module reloading if (module.hot) { setupHotReloading(); - // prettier-ignore - module.hot.accept([ - './audio', - './chat', - './game', - './Notifications', - './Panel', - './ping', - './settings', - './telemetry', - ], () => { - renderApp(); - }); + + module.hot.accept( + [ + './audio', + './chat', + './game', + './Notifications', + './Panel', + './ping', + './settings', + './telemetry', + ], + () => { + renderApp(); + } + ); } }; diff --git a/tgui/packages/tgui-panel/package.json b/tgui/packages/tgui-panel/package.json index d60ccaaa9b..7aab57e169 100644 --- a/tgui/packages/tgui-panel/package.json +++ b/tgui/packages/tgui-panel/package.json @@ -1,8 +1,10 @@ { "private": true, "name": "tgui-panel", - "version": "4.3.1", + "version": "5.0.0", "dependencies": { + "@types/node": "^14.x", + "@types/react": "^18.2.42", "common": "workspace:*", "dompurify": "^2.3.1", "inferno": "^7.4.8", diff --git a/tgui/packages/tgui-panel/ping/actions.js b/tgui/packages/tgui-panel/ping/actions.ts similarity index 100% rename from tgui/packages/tgui-panel/ping/actions.js rename to tgui/packages/tgui-panel/ping/actions.ts diff --git a/tgui/packages/tgui-panel/ping/reducer.js b/tgui/packages/tgui-panel/ping/reducer.ts similarity index 82% rename from tgui/packages/tgui-panel/ping/reducer.js rename to tgui/packages/tgui-panel/ping/reducer.ts index b1e3d679cb..fcab775548 100644 --- a/tgui/packages/tgui-panel/ping/reducer.js +++ b/tgui/packages/tgui-panel/ping/reducer.ts @@ -8,7 +8,14 @@ import { clamp01, scale } from 'common/math'; import { pingFail, pingSuccess } from './actions'; import { PING_MAX_FAILS, PING_ROUNDTRIP_BEST, PING_ROUNDTRIP_WORST } from './constants'; -export const pingReducer = (state = {}, action) => { +type PingState = { + roundtrip: number | undefined; + roundtripAvg: number | undefined; + failCount: number; + networkQuality: number; +}; + +export const pingReducer = (state = {} as PingState, action) => { const { type, payload } = action; if (type === pingSuccess.type) { @@ -30,7 +37,7 @@ export const pingReducer = (state = {}, action) => { const networkQuality = clamp01( state.networkQuality - failCount / PING_MAX_FAILS ); - const nextState = { + const nextState: PingState = { ...state, failCount: failCount + 1, networkQuality, diff --git a/tgui/packages/tgui-panel/ping/selectors.js b/tgui/packages/tgui-panel/ping/selectors.ts similarity index 100% rename from tgui/packages/tgui-panel/ping/selectors.js rename to tgui/packages/tgui-panel/ping/selectors.ts diff --git a/tgui/packages/tgui-panel/settings/actions.js b/tgui/packages/tgui-panel/settings/actions.ts similarity index 100% rename from tgui/packages/tgui-panel/settings/actions.js rename to tgui/packages/tgui-panel/settings/actions.ts diff --git a/tgui/packages/tgui-panel/settings/hooks.js b/tgui/packages/tgui-panel/settings/hooks.ts similarity index 100% rename from tgui/packages/tgui-panel/settings/hooks.js rename to tgui/packages/tgui-panel/settings/hooks.ts diff --git a/tgui/packages/tgui-panel/settings/model.js b/tgui/packages/tgui-panel/settings/model.ts similarity index 69% rename from tgui/packages/tgui-panel/settings/model.js rename to tgui/packages/tgui-panel/settings/model.ts index 501bd42e7e..9539a57182 100644 --- a/tgui/packages/tgui-panel/settings/model.js +++ b/tgui/packages/tgui-panel/settings/model.ts @@ -3,7 +3,7 @@ */ import { createUuid } from 'common/uuid'; -export const createHighlightSetting = (obj) => ({ +export const createHighlightSetting = (obj?: Record) => ({ id: createUuid(), highlightText: '', blacklistText: '', @@ -15,7 +15,7 @@ export const createHighlightSetting = (obj) => ({ ...obj, }); -export const createDefaultHighlightSetting = (obj) => +export const createDefaultHighlightSetting = (obj?: Record) => createHighlightSetting({ id: 'default', ...obj, diff --git a/tgui/packages/tgui-panel/settings/selectors.js b/tgui/packages/tgui-panel/settings/selectors.ts similarity index 100% rename from tgui/packages/tgui-panel/settings/selectors.js rename to tgui/packages/tgui-panel/settings/selectors.ts diff --git a/tgui/packages/tgui-panel/telemetry.js b/tgui/packages/tgui-panel/telemetry.js index d1f7346af6..bade3c6391 100644 --- a/tgui/packages/tgui-panel/telemetry.js +++ b/tgui/packages/tgui-panel/telemetry.js @@ -11,12 +11,10 @@ const logger = createLogger('telemetry'); const MAX_CONNECTIONS_STORED = 10; -// prettier-ignore -const connectionsMatch = (a, b) => ( - a.ckey === b.ckey - && a.address === b.address - && a.computer_id === b.computer_id -); +const connectionsMatch = (a, b) => + a.ckey === b.ckey && + a.address === b.address && + a.computer_id === b.computer_id; export const telemetryMiddleware = (store) => { let telemetry; @@ -58,9 +56,10 @@ export const telemetryMiddleware = (store) => { } // Append a connection record let telemetryMutated = false; - // prettier-ignore - const duplicateConnection = telemetry.connections - .find(conn => connectionsMatch(conn, client)); + + const duplicateConnection = telemetry.connections.find((conn) => + connectionsMatch(conn, client) + ); if (!duplicateConnection) { telemetryMutated = true; telemetry.connections.unshift(client); diff --git a/tgui/packages/tgui-panel/themes.js b/tgui/packages/tgui-panel/themes.ts similarity index 99% rename from tgui/packages/tgui-panel/themes.js rename to tgui/packages/tgui-panel/themes.ts index f6acc36e1b..f7bef0970e 100644 --- a/tgui/packages/tgui-panel/themes.js +++ b/tgui/packages/tgui-panel/themes.ts @@ -10,7 +10,7 @@ const COLOR_DARK_BG = '#202020'; const COLOR_DARK_BG_DARKER = '#171717'; const COLOR_DARK_TEXT = '#a4bad6'; -let setClientThemeTimer = null; +let setClientThemeTimer: NodeJS.Timeout; /** * Darkmode preference, originally by Kmc2000. diff --git a/tgui/packages/tgui/backend.ts b/tgui/packages/tgui/backend.ts index 6255c59487..4a45529c65 100644 --- a/tgui/packages/tgui/backend.ts +++ b/tgui/packages/tgui/backend.ts @@ -21,6 +21,12 @@ import { resumeRenderer, suspendRenderer } from './renderer'; const logger = createLogger('backend'); +export let globalStore; + +export const setGlobalStore = (store) => { + globalStore = store; +}; + export const backendUpdate = createAction('backend/update'); export const backendSetSharedState = createAction('backend/setSharedState'); export const backendSuspendStart = createAction('backend/suspendStart'); @@ -275,6 +281,10 @@ type BackendState = { shared: Record; suspending: boolean; suspended: boolean; + debug?: { + debugLayout: boolean; + kitchenSink: boolean; + }; }; /** @@ -288,9 +298,9 @@ export const selectBackend = (state: any): BackendState => * * Includes the `act` function for performing DM actions. */ -export const useBackend = (context: any) => { - const { store } = context; - const state = selectBackend(store.getState()); +export const useBackend = () => { + const state: BackendState = globalStore?.getState()?.backend; + return { ...state, act: sendAct, @@ -316,18 +326,16 @@ type StateWithSetter = [T, (nextState: T) => void]; * @param initialState Initializes your global variable with this value. */ export const useLocalState = ( - context: any, key: string, initialState: T ): StateWithSetter => { - const { store } = context; - const state = selectBackend(store.getState()); - const sharedStates = state.shared ?? {}; + const state = globalStore?.getState()?.backend; + const sharedStates = state?.shared ?? {}; const sharedState = key in sharedStates ? sharedStates[key] : initialState; return [ sharedState, (nextState) => { - store.dispatch( + globalStore.dispatch( backendSetSharedState({ key, nextState: @@ -355,26 +363,22 @@ export const useLocalState = ( * @param initialState Initializes your global variable with this value. */ export const useSharedState = ( - context: any, key: string, initialState: T ): StateWithSetter => { - const { store } = context; - const state = selectBackend(store.getState()); - const sharedStates = state.shared ?? {}; + const state = globalStore?.getState()?.backend; + const sharedStates = state?.shared ?? {}; const sharedState = key in sharedStates ? sharedStates[key] : initialState; return [ sharedState, (nextState) => { - // prettier-ignore Byond.sendMessage({ type: 'setSharedState', key, - value: JSON.stringify( - typeof nextState === 'function' - ? nextState(sharedState) - : nextState - ) || '', + value: + JSON.stringify( + typeof nextState === 'function' ? nextState(sharedState) : nextState + ) || '', }); }, ]; diff --git a/tgui/packages/tgui/components/Dropdown.tsx b/tgui/packages/tgui/components/Dropdown.tsx index 0d417af459..7fa0e3ae8d 100644 --- a/tgui/packages/tgui/components/Dropdown.tsx +++ b/tgui/packages/tgui/components/Dropdown.tsx @@ -180,33 +180,24 @@ export class Dropdown extends Component { const to_render = ops.length ? ops : 'No Options Found'; - render( -
{to_render}
, - renderedMenu, - () => { - let singletonPopper = Dropdown.singletonPopper; - if (singletonPopper === undefined) { - singletonPopper = createPopper( - Dropdown.virtualElement, - renderedMenu!, - { - ...DEFAULT_OPTIONS, - placement: 'bottom-start', - } - ); + render(
{to_render}
, renderedMenu, () => { + let singletonPopper = Dropdown.singletonPopper; + if (singletonPopper === undefined) { + singletonPopper = createPopper(Dropdown.virtualElement, renderedMenu!, { + ...DEFAULT_OPTIONS, + placement: 'bottom-start', + }); - Dropdown.singletonPopper = singletonPopper; - } else { - singletonPopper.setOptions({ - ...DEFAULT_OPTIONS, - placement: 'bottom-start', - }); + Dropdown.singletonPopper = singletonPopper; + } else { + singletonPopper.setOptions({ + ...DEFAULT_OPTIONS, + placement: 'bottom-start', + }); - singletonPopper.update(); - } - }, - this.context - ); + singletonPopper.update(); + } + }); } setOpen(open: boolean) { diff --git a/tgui/packages/tgui/components/Popper.tsx b/tgui/packages/tgui/components/Popper.tsx index 1d6c4a73a7..907896d6b8 100644 --- a/tgui/packages/tgui/components/Popper.tsx +++ b/tgui/packages/tgui/components/Popper.tsx @@ -70,12 +70,7 @@ export class Popper extends Component { renderPopperContent(callback: () => void) { // `render` errors when given false, so we convert it to `null`, // which is supported. - render( - this.props.popperContent || null, - this.renderedContent, - callback, - this.context - ); + render(this.props.popperContent || null, this.renderedContent, callback); } render() { diff --git a/tgui/packages/tgui/components/TextArea.jsx b/tgui/packages/tgui/components/TextArea.jsx index d8283063b0..09661ca264 100644 --- a/tgui/packages/tgui/components/TextArea.jsx +++ b/tgui/packages/tgui/components/TextArea.jsx @@ -12,8 +12,8 @@ import { toInputValue } from './Input'; import { KEY_ENTER, KEY_ESCAPE, KEY_TAB } from 'common/keycodes'; export class TextArea extends Component { - constructor(props, context) { - super(props, context); + constructor(props) { + super(props); this.textareaRef = props.innerRef || createRef(); this.state = { editing: false, diff --git a/tgui/packages/tgui/debug/KitchenSink.jsx b/tgui/packages/tgui/debug/KitchenSink.jsx index 246b4f50b4..cd6ba33c42 100644 --- a/tgui/packages/tgui/debug/KitchenSink.jsx +++ b/tgui/packages/tgui/debug/KitchenSink.jsx @@ -20,10 +20,10 @@ const r = require.context('../stories', false, /\.stories\.js$/); */ const getStories = () => r.keys().map((path) => r(path)); -export const KitchenSink = (props, context) => { +export const KitchenSink = (props) => { const { panel } = props; - const [theme] = useLocalState(context, 'kitchenSinkTheme'); - const [pageIndex, setPageIndex] = useLocalState(context, 'pageIndex', 0); + const [theme] = useLocalState('kitchenSinkTheme'); + const [pageIndex, setPageIndex] = useLocalState('pageIndex', 0); const stories = getStories(); const story = stories[pageIndex]; const Layout = panel ? Pane : Window; diff --git a/tgui/packages/tgui/index.tsx b/tgui/packages/tgui/index.tsx index d0e276ff8f..b1e6635d35 100644 --- a/tgui/packages/tgui/index.tsx +++ b/tgui/packages/tgui/index.tsx @@ -19,7 +19,7 @@ import './styles/themes/syndicate.scss'; import './styles/themes/wizard.scss'; import './styles/themes/abstract.scss'; -import { StoreProvider, configureStore } from './store'; +import { configureStore } from './store'; import { captureExternalLinks } from './links'; import { createRenderer } from './renderer'; @@ -27,6 +27,7 @@ import { perf } from 'common/perf'; import { setupGlobalEvents } from './events'; import { setupHotKeys } from './hotkeys'; import { setupHotReloading } from 'tgui-dev-server/link/client.cjs'; +import { setGlobalStore } from './backend'; perf.mark('inception', window.performance?.timing?.navigationStart); perf.mark('init'); @@ -34,13 +35,11 @@ perf.mark('init'); const store = configureStore(); const renderApp = createRenderer(() => { + setGlobalStore(store); + const { getRoutedComponent } = require('./routes'); const Component = getRoutedComponent(store); - return ( - - - - ); + return ; }); const setupApp = () => { diff --git a/tgui/packages/tgui/interfaces/AICard.jsx b/tgui/packages/tgui/interfaces/AICard.jsx index c0695e414a..a2b9105812 100644 --- a/tgui/packages/tgui/interfaces/AICard.jsx +++ b/tgui/packages/tgui/interfaces/AICard.jsx @@ -2,8 +2,8 @@ import { useBackend } from '../backend'; import { Button, ProgressBar, LabeledList, Box, Section } from '../components'; import { Window } from '../layouts'; -export const AICard = (props, context) => { - const { act, data } = useBackend(context); +export const AICard = (props) => { + const { act, data } = useBackend(); const { has_ai, diff --git a/tgui/packages/tgui/interfaces/APC.jsx b/tgui/packages/tgui/interfaces/APC.jsx index ef13cc098a..29acd63819 100644 --- a/tgui/packages/tgui/interfaces/APC.jsx +++ b/tgui/packages/tgui/interfaces/APC.jsx @@ -5,8 +5,8 @@ import { Window } from '../layouts'; import { InterfaceLockNoticeBox } from './common/InterfaceLockNoticeBox'; import { FullscreenNotice } from './common/FullscreenNotice'; -export const APC = (props, context) => { - const { act, data } = useBackend(context); +export const APC = (props) => { + const { act, data } = useBackend(); let body = ; @@ -64,8 +64,8 @@ const malfMap = { // }, }; -const ApcContent = (props, context) => { - const { act, data } = useBackend(context); +const ApcContent = (props) => { + const { act, data } = useBackend(); const locked = data.locked && !data.siliconUser; const normallyLocked = data.normallyLocked; const externalPowerStatus = @@ -260,7 +260,7 @@ const ApcContent = (props, context) => { ); }; -const GridCheck = (props, context) => { +const GridCheck = (props) => { return ( @@ -278,8 +278,8 @@ const GridCheck = (props, context) => { ); }; -const ApcFailure = (props, context) => { - const { data, act } = useBackend(context); +const ApcFailure = (props) => { + const { data, act } = useBackend(); let rebootOptions = (