diff --git a/src/app/area/[[...slug]]/sections/ClimbListSection.tsx b/src/app/area/[[...slug]]/sections/ClimbListSection.tsx index 94b09572b..9c4ae1ec8 100644 --- a/src/app/area/[[...slug]]/sections/ClimbListSection.tsx +++ b/src/app/area/[[...slug]]/sections/ClimbListSection.tsx @@ -1,4 +1,3 @@ -import { Plus } from '@phosphor-icons/react/dist/ssr' import { ClimbList } from '@/app/editArea/[slug]/general/components/climb/ClimbListForm' import { AreaType } from '@/js/types' /** @@ -17,7 +16,7 @@ export const ClimbListSection: React.FC<{ area: AreaType, editMode?: boolean }> {!editMode &&
- New Climbs + Add Climbs
} diff --git a/src/app/editArea/[slug]/general/components/AddAreaForm.tsx b/src/app/editArea/[slug]/general/components/AddAreaForm.tsx index b1508419d..488051737 100644 --- a/src/app/editArea/[slug]/general/components/AddAreaForm.tsx +++ b/src/app/editArea/[slug]/general/components/AddAreaForm.tsx @@ -27,8 +27,10 @@ export const AddAreaForm: React.FC<{ area: AreaType }> = ({ area }) => { initialValues={{ areaName: '' }} keepValuesAfterReset={false} + validationMode='onSubmit' + ignoreIsValid title='Add new area' - helperText='TIP: Pick “AREA” if not sure. You can still change it later.' + helperText='TIP: Pick “AREA” type if not sure. You can change it later.' submitHandler={async ({ areaName, areaType }) => { const { isBoulder, isLeaf } = areaDesignationToDb(areaType) await addOneAreaCmd({ name: areaName, parentUuid: uuid, isBoulder, isLeaf }) @@ -39,7 +41,7 @@ export const AddAreaForm: React.FC<{ area: AreaType }> = ({ area }) => { {notEditable &&
- This area is either a crag or a boulder. Adding a new child area is not allowed. + This area is either a crag or a boulder. Adding new child areas is not allowed.
} - {climbs.length === 0 &&
No climbs found. Use the form below to add new climbs.
} + {climbs.length === 0 + ? ( + editMode + ? + : + ) + : null}
    {sortedClimbs.map((climb, index) => { return ( @@ -90,3 +96,16 @@ const DisciplinesInfo: React.FC<{ disciplines: Partial }> ) } + +const NoClimbsEditModeCTA: React.FC = () => ( +
    No climbs found. Use the form below to add new climbs.
    +) + +const NoClimbsCTA: React.FC<{ areaId: string }> = ({ areaId }) => ( +
    + No climbs found.  + + Add Climbs + +
    +)