From 968970b332b6f643051837765211295c6ef13e8d Mon Sep 17 00:00:00 2001 From: Justin Edmund Date: Mon, 23 Jan 2023 02:46:58 -0800 Subject: [PATCH] Fix errors from props on HTML elements --- components/JobSection/index.tsx | 28 +++++++++++++++++++++------- components/SelectItem/index.tsx | 6 +++--- 2 files changed, 24 insertions(+), 10 deletions(-) diff --git a/components/JobSection/index.tsx b/components/JobSection/index.tsx index 8411cfbb..0715cf63 100644 --- a/components/JobSection/index.tsx +++ b/components/JobSection/index.tsx @@ -127,6 +127,26 @@ const JobSection = (props: Props) => { props.saveSkill(skill, position) } + const emptyJobLabel = ( +
+

{t('no_job')}

+
+ ) + + const filledJobLabel = ( +
+ {job?.name[locale]} +

{job?.name[locale]}

+
+ ) + + function jobLabel() { + return job ? filledJobLabel : emptyJobLabel + } + // Render: JSX components return (
@@ -146,13 +166,7 @@ const JobSection = (props: Props) => { ref={selectRef} /> ) : ( -
- {party.job.name[locale]} -

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

-
+ jobLabel() )}