Skip to content

Commit

Permalink
Merge pull request #258 from tchryssos/tc-fix-sotww-path
Browse files Browse the repository at this point in the history
show path if path exists
  • Loading branch information
tchryssos authored Nov 16, 2024
2 parents 925163c + eaa8131 commit ced9c99
Showing 1 changed file with 10 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,23 @@ const iconMap: Record<SotwwPathType, RpgIcons> = {

export function PathInputs() {
const { watch } = useFormContext<SotwwCharacterData>();
const level = watch('level');
const { isEditMode } = useContext(EditContext);

const expertPath = watch('path_expert');
const expertPathDetails = watch('path_expert_benefits');
const masterPath = watch('path_master');
const masterPathDetails = watch('path_master_benefits');

const showExpert = Boolean(expertPath || expertPathDetails.length);
const showMaster = Boolean(masterPath || masterPathDetails.length);

return (
<>
<PathInput icon={iconMap.novice} pathType="novice" />
{(level >= 3 || isEditMode) && (
{(showExpert || isEditMode) && (
<PathInput icon={iconMap.expert} pathType="expert" />
)}
{(level >= 7 || isEditMode) && (
{(showMaster || isEditMode) && (
<PathInput icon={iconMap.master} pathType="master" />
)}
</>
Expand Down

0 comments on commit ced9c99

Please sign in to comment.