mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-30 07:28:53 +01:00
Refactor pda into a proper module
This commit is contained in:
@@ -1,11 +1,10 @@
|
||||
import { BooleanLike } from 'common/react';
|
||||
import { useState } from 'react';
|
||||
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, Flex, Icon, LabeledList, Section } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, Flex, Icon, LabeledList, Section } from 'tgui/components';
|
||||
import { Window } from 'tgui/layouts';
|
||||
/* This is all basically stolen from routes.js. */
|
||||
import { routingError } from '../routes';
|
||||
import { routingError } from 'tgui/routes';
|
||||
|
||||
type Data = {
|
||||
owner: string;
|
||||
@@ -25,7 +24,7 @@ type Data = {
|
||||
};
|
||||
};
|
||||
|
||||
const requirePdaInterface = require.context('./pda', false, /\.tsx$/);
|
||||
const requirePdaInterface = require.context('./pda_screens', false, /\.tsx$/);
|
||||
|
||||
function getPdaApp(name: string) {
|
||||
let appModule: __WebpackModuleApi.RequireContext;
|
||||
+2
-3
@@ -1,8 +1,7 @@
|
||||
import { filter } from 'common/collections';
|
||||
import { decodeHtmlEntities } from 'common/string';
|
||||
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, LabeledList } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, LabeledList } from 'tgui/components';
|
||||
|
||||
type Data = {
|
||||
aircontents: aircontent[];
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, LabeledList, Section } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, LabeledList, Section } from 'tgui/components';
|
||||
|
||||
type Data = {
|
||||
janitor: {
|
||||
+2
-3
@@ -1,7 +1,6 @@
|
||||
import { BooleanLike } from 'common/react';
|
||||
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, LabeledList, Section } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, LabeledList, Section } from 'tgui/components';
|
||||
|
||||
type Data = {
|
||||
owner: string;
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box } from '../../components';
|
||||
import { CrewManifestContent } from '../CrewManifest';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box } from 'tgui/components';
|
||||
|
||||
import { CrewManifestContent } from '../../CrewManifest';
|
||||
|
||||
export const pda_manifest = (props) => {
|
||||
const { act, data } = useBackend();
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, LabeledList, Section } from '../../components';
|
||||
import { GeneralRecord, MedicalRecord, RecordList } from './pda_types';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, LabeledList, Section } from 'tgui/components';
|
||||
|
||||
import { GeneralRecord, MedicalRecord, RecordList } from '../pda_types';
|
||||
|
||||
type Data = {
|
||||
records: {
|
||||
+2
-3
@@ -2,9 +2,8 @@ import { filter } from 'common/collections';
|
||||
import { BooleanLike } from 'common/react';
|
||||
import { decodeHtmlEntities } from 'common/string';
|
||||
import { useState } from 'react';
|
||||
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, LabeledList, Section } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, LabeledList, Section } from 'tgui/components';
|
||||
|
||||
type Data = {
|
||||
active_conversation: string;
|
||||
+2
-3
@@ -1,8 +1,7 @@
|
||||
import { BooleanLike } from 'common/react';
|
||||
import { decodeHtmlEntities } from 'common/string';
|
||||
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, Image, Section } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, Image, Section } from 'tgui/components';
|
||||
|
||||
type Data = {
|
||||
feeds: feed[];
|
||||
+2
-2
@@ -1,6 +1,6 @@
|
||||
/* eslint react/no-danger: "off" */
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, Section, Table } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, Section, Table } from 'tgui/components';
|
||||
|
||||
type Data = { note: string; notename: string };
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
import { PowerMonitorContent } from '../../PowerMonitor/PowerMonitorContent';
|
||||
|
||||
export const pda_power = (props) => {
|
||||
return <PowerMonitorContent />;
|
||||
};
|
||||
+4
-3
@@ -1,6 +1,7 @@
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, LabeledList, Section } from '../../components';
|
||||
import { GeneralRecord, RecordList, SecurityRecord } from './pda_types';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, LabeledList, Section } from 'tgui/components';
|
||||
|
||||
import { GeneralRecord, RecordList, SecurityRecord } from '../pda_types';
|
||||
|
||||
type Data = {
|
||||
records: {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { SignalerContent } from '../Signaler';
|
||||
import { SignalerContent } from '../../Signaler';
|
||||
|
||||
export const pda_signaller = (props) => {
|
||||
return <SignalerContent />;
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, Button, LabeledList } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, Button, LabeledList } from 'tgui/components';
|
||||
|
||||
type Data = { records: { message1: string; message2: string } | null };
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { useBackend } from '../../backend';
|
||||
import { Box, LabeledList, Section } from '../../components';
|
||||
import { useBackend } from 'tgui/backend';
|
||||
import { Box, LabeledList, Section } from 'tgui/components';
|
||||
|
||||
type Data = {
|
||||
supply: {
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { IconProps } from '../../components/Icon';
|
||||
import { IconProps } from 'tgui/components/Icon';
|
||||
/**
|
||||
* Gernal Record data
|
||||
*/
|
||||
@@ -3,7 +3,7 @@ import { BooleanLike } from 'common/react';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, LabeledList, Section } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
import { GeneralRecord, MedicalRecord, RecordList } from './pda/pda_types';
|
||||
import { GeneralRecord, MedicalRecord, RecordList } from './Pda/pda_types';
|
||||
|
||||
type Data = {
|
||||
records: RecordList;
|
||||
|
||||
@@ -3,7 +3,7 @@ import { BooleanLike } from 'common/react';
|
||||
import { useBackend } from '../backend';
|
||||
import { Box, Button, LabeledList, Section } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
import { GeneralRecord, RecordList, SecurityRecord } from './pda/pda_types';
|
||||
import { GeneralRecord, RecordList, SecurityRecord } from './Pda/pda_types';
|
||||
|
||||
type Data = {
|
||||
records: RecordList;
|
||||
|
||||
@@ -1,5 +0,0 @@
|
||||
import { PowerMonitorContent } from '../PowerMonitor/PowerMonitorContent';
|
||||
|
||||
export const pda_power = (props) => {
|
||||
return <PowerMonitorContent />;
|
||||
};
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user