a tool for shared writing and social publishing
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

rm see full leaflet button on subpages to reduce complexity and mobile vs desktop consistancy issues

celine e96b3c1e 71a7ea8b

+10 -27
+10 -27
components/HomeButton.tsx
··· 1 1 import Link from "next/link"; 2 2 import { useEntitySetContext } from "./EntitySetProvider"; 3 - import { BackToLeafletSmall, HomeSmall } from "./Icons"; 3 + import { HomeSmall } from "./Icons"; 4 4 import { HoverButton } from "./Buttons"; 5 - import { useState } from "react"; 6 5 import { useParams, useSearchParams } from "next/navigation"; 7 6 8 7 export function HomeButton() { 9 8 let { permissions } = useEntitySetContext(); 10 9 let searchParams = useSearchParams(); 11 - let params = useParams(); 12 - let isSubpage = !!searchParams.get("page"); 13 10 14 11 if (permissions.write) 15 12 return ( 16 - <> 17 - {isSubpage && ( 18 - <Link href={`/${params.leaflet_id}`} prefetch> 19 - <HoverButton 20 - noLabelOnMobile 21 - icon={<BackToLeafletSmall />} 22 - label="See Full Leaflet" 23 - background="bg-accent-1" 24 - text="text-accent-2" 25 - /> 26 - </Link> 27 - )} 28 - 29 - <Link href="/home" prefetch> 30 - <HoverButton 31 - noLabelOnMobile 32 - icon={<HomeSmall />} 33 - label="Go Home" 34 - background="bg-accent-1" 35 - text="text-accent-2" 36 - /> 37 - </Link> 38 - </> 13 + <Link href="/home" prefetch> 14 + <HoverButton 15 + noLabelOnMobile 16 + icon={<HomeSmall />} 17 + label="Go Home" 18 + background="bg-accent-1" 19 + text="text-accent-2" 20 + /> 21 + </Link> 39 22 ); 40 23 return null; 41 24 }