From abb50c82e7e8fec6233e7fef4fae8da034355123 Mon Sep 17 00:00:00 2001 From: meemofcourse <75212565+meemofcourse@users.noreply.github.com> Date: Sun, 21 Jan 2024 05:31:33 -0300 Subject: [PATCH] linters... --- .../tgui/interfaces/RequestManager.js | 61 ++++++++++++++----- 1 file changed, 47 insertions(+), 14 deletions(-) diff --git a/tgui/packages/tgui/interfaces/RequestManager.js b/tgui/packages/tgui/interfaces/RequestManager.js index a55be0e28de0..5d8d2c468a53 100644 --- a/tgui/packages/tgui/interfaces/RequestManager.js +++ b/tgui/packages/tgui/interfaces/RequestManager.js @@ -16,19 +16,24 @@ export const RequestManager = (props, context) => { const [filteredTypes, _] = useLocalState( context, 'filteredTypes', - Object.fromEntries(Object.entries(displayTypeMap).map(([type, _]) => [type, true])) + Object.fromEntries( + Object.entries(displayTypeMap).map(([type, _]) => [type, true]) + ) ); const [searchText, setSearchText] = useLocalState(context, 'searchText'); // Handle filtering - let displayedRequests = requests.filter((request) => filteredTypes[request.req_type]); + let displayedRequests = requests.filter( + (request) => filteredTypes[request.req_type] + ); if (searchText) { const filterText = searchText.toLowerCase(); displayedRequests = displayedRequests.filter( (request) => decodeHtmlEntities(request.message) .toLowerCase() - .includes(filterText) || request.owner_name.toLowerCase().includes(filterText) + .includes(filterText) || + request.owner_name.toLowerCase().includes(filterText) ); } @@ -39,10 +44,16 @@ export const RequestManager = (props, context) => { title="Requests" buttons={ <> - setSearchText(value)} placeholder={'Search...'} mr={1} /> + setSearchText(value)} + placeholder={'Search...'} + mr={1} + /> - }> + } + > {displayedRequests.map((request) => (
@@ -51,7 +62,9 @@ export const RequestManager = (props, context) => { {request.owner_name} {request.owner === null && ' [DC]'} - {request.timestamp_str} + + {request.timestamp_str} +
@@ -78,7 +91,11 @@ const displayTypeMap = { const RequestType = (props) => { const { requestType } = props; - return {displayTypeMap[requestType]}:; + return ( + + {displayTypeMap[requestType]}: + + ); }; const RequestControls = (props, context) => { @@ -94,19 +111,33 @@ const RequestControls = (props, context) => { - {request.req_type !== 'request_prayer' && } - {request.req_type === 'request_nuke' && } - {request.req_type === 'request_fax' && } + {request.req_type !== 'request_prayer' && ( + + )} + {request.req_type === 'request_nuke' && ( + + )} + {request.req_type === 'request_fax' && ( + + )}
); }; const FilterPanel = (_, context) => { - const [filterVisible, setFilterVisible] = useLocalState(context, 'filterVisible', false); + const [filterVisible, setFilterVisible] = useLocalState( + context, + 'filterVisible', + false + ); const [filteredTypes, setFilteredTypes] = useLocalState( context, 'filteredTypes', - Object.fromEntries(Object.entries(displayTypeMap).map(([type, _]) => [type, true])) + Object.fromEntries( + Object.entries(displayTypeMap).map(([type, _]) => [type, true]) + ) ); return ( @@ -119,7 +150,8 @@ const FilterPanel = (_, context) => { className="RequestManager__filterPanel" style={{ display: filterVisible ? 'block' : 'none', - }}> + }} + > {Object.keys(displayTypeMap).map((type) => { return ( @@ -142,7 +174,8 @@ const FilterPanel = (_, context) => { })}
- }> + } + >