Skip to content

Commit

Permalink
refactor: don't show share button on area page
Browse files Browse the repository at this point in the history
  • Loading branch information
clintonlunn committed Dec 7, 2024
1 parent f912389 commit deec60a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/components/maps/TileHandlers/CragContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ export const CragDrawerContent: React.FC<CragFeatureProperties> = ({ id, areaNam
const friendlyUrl = getAreaPageFriendlyUrl(id, areaName)
const editUrl = `/editArea/${id}/general`
const pathname = `${usePathname()}${window.location.search}`
const isAreaPage = pathname.startsWith('/area/')

return (
<>
Expand All @@ -19,7 +20,7 @@ export const CragDrawerContent: React.FC<CragFeatureProperties> = ({ id, areaNam
heading={<Link href={friendlyUrl}>{areaName}</Link>}
subheading={<Subheading id={id} totalClimbs={climbs.length} />}
cta={<Link className='btn btn-primary btn-outline btn-sm no-animation' href={editUrl}>Edit area</Link>}
share={<SharePageURLButton path={pathname} name='' />}
share={!isAreaPage && <SharePageURLButton path={pathname} name='' />}
>
<section className='text-sm'>
{description == null || description.trim() === ''
Expand Down

0 comments on commit deec60a

Please sign in to comment.