From 9e999e4ec11f90cd60f47c5ad65e58c761a67cee Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 8 Jan 2024 04:05:41 -0800 Subject: [PATCH] Small refactor --- components/job/JobSection/index.tsx | 44 ++++++++++++++++------------- 1 file changed, 25 insertions(+), 19 deletions(-) diff --git a/components/job/JobSection/index.tsx b/components/job/JobSection/index.tsx index 15a0ea13..44a4f21a 100644 --- a/components/job/JobSection/index.tsx +++ b/components/job/JobSection/index.tsx @@ -184,6 +184,30 @@ const JobSection = (props: Props) => { ) + const renderJobDropdown = () => { + if (props.editable) { + return ( + + ) + } else { + return ( +
+ {party.job && ( + {party.job.name[locale]} + )} +

{party.job ? party.job.name[locale] : t('no_job')}

+
+ ) + } + } + // Render: JSX components return (
@@ -196,25 +220,7 @@ const JobSection = (props: Props) => { onAccessorySelected={handleAccessorySelected} />
- {props.editable ? ( - - ) : ( -
- {party.job ? ( - {party.job.name[locale]} - ) : ( - '' - )} -

{party.job ? party.job.name[locale] : t('no_job')}

-
- )} + {renderJobDropdown()}
    {[...Array(numSkills)].map((e, i) => (