Skip to content

Commit

Permalink
climbing: hide NoImage placeholder for climbing=area
Browse files Browse the repository at this point in the history
  • Loading branch information
zbycz committed Feb 9, 2025
1 parent 2d0cf14 commit 18b5e28
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/FeaturePanel/CragsInArea.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ export const CragsInArea = () => {
? `${t('featurepanel.climbing_sectors_in')} ${feature.tags.name}`
: ''}
</PanelLabel>
<Box mt={2} mb={2}>
<Box mt={2} mb={4}>
<CragList>
{crags.map((item) => (
<CragItem key={getOsmappLink(item)} feature={item} />
Expand Down
9 changes: 8 additions & 1 deletion src/components/FeaturePanel/FeatureImages/FeatureImages.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import { NoImage } from './NoImage';
import { HEIGHT, ImageSkeleton } from './helpers';
import { naturalSort } from '../Climbing/utils/array';
import { PROJECT_ID } from '../../../services/project';
import { useFeatureContext } from '../../utils/FeatureContext';

const isOpenClimbing = PROJECT_ID === 'openclimbing';

Expand Down Expand Up @@ -34,9 +35,15 @@ export const Slider = ({ children }) => (
);

export const FeatureImages = () => {
const { feature } = useFeatureContext();
const { loading, images } = useLoadImages();
if (images.length === 0) {
return <Wrapper>{loading ? <ImageSkeleton /> : <NoImage />}</Wrapper>;
// CragsInArea condition
if (feature.memberFeatures?.length && feature.tags.climbing === 'area') {
return null;
} else {
return <Wrapper>{loading ? <ImageSkeleton /> : <NoImage />}</Wrapper>;
}
}

return (
Expand Down

0 comments on commit 18b5e28

Please sign in to comment.