From b777f14be54330579d33ffcea76645786ca29892 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Thu, 5 Oct 2023 15:22:47 -0400 Subject: [PATCH 1/2] tgui research desktop --- tgui/packages/tgui/interfaces/ResearchTerminal.tsx | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/tgui/packages/tgui/interfaces/ResearchTerminal.tsx b/tgui/packages/tgui/interfaces/ResearchTerminal.tsx index c40af65ea44d..fb48bceee6e7 100644 --- a/tgui/packages/tgui/interfaces/ResearchTerminal.tsx +++ b/tgui/packages/tgui/interfaces/ResearchTerminal.tsx @@ -142,6 +142,7 @@ const CompoundRecord = (props: CompoundRecordProps, context) => { 'print_type': compound.category, 'print_title': compound.id, }; + const isThreeWords = compound.type.document.split(' ')[0] === 'Simulation'; return ( @@ -153,9 +154,16 @@ const CompoundRecord = (props: CompoundRecordProps, context) => { - - {compound.type.document.split(' ')[2]} - + {!isThreeWords && ( + + {compound.type.document.split(' ')[2]} + + )} + {isThreeWords && ( + + {compound.type.document.split(' ')[3]} + + )} From dbad049919d4d6cf73cd28e6ac8771464d702825 Mon Sep 17 00:00:00 2001 From: kiVts <48099872+kiVts@users.noreply.github.com> Date: Thu, 5 Oct 2023 19:55:48 -0400 Subject: [PATCH 2/2] ternary --- tgui/packages/tgui/interfaces/ResearchTerminal.tsx | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tgui/packages/tgui/interfaces/ResearchTerminal.tsx b/tgui/packages/tgui/interfaces/ResearchTerminal.tsx index fb48bceee6e7..efa0724bf258 100644 --- a/tgui/packages/tgui/interfaces/ResearchTerminal.tsx +++ b/tgui/packages/tgui/interfaces/ResearchTerminal.tsx @@ -142,7 +142,6 @@ const CompoundRecord = (props: CompoundRecordProps, context) => { 'print_type': compound.category, 'print_title': compound.id, }; - const isThreeWords = compound.type.document.split(' ')[0] === 'Simulation'; return ( @@ -154,14 +153,13 @@ const CompoundRecord = (props: CompoundRecordProps, context) => { - {!isThreeWords && ( + {compound.type.document.split(' ')[0] === 'Simulation' ? ( - {compound.type.document.split(' ')[2]} + {compound.type.document.split(' ')[3]} - )} - {isThreeWords && ( + ) : ( - {compound.type.document.split(' ')[3]} + {compound.type.document.split(' ')[2]} )}