a tool for shared writing and social publishing

fix share button, home button, and secondary button

+19 -9
+5 -4
components/Buttons.tsx
··· 68 68 } = props; 69 69 return ( 70 70 <button 71 - {...props} 71 + {...buttonProps} 72 72 ref={ref} 73 73 className={`m-0 h-max 74 74 ${fullWidth ? "w-full" : fullWidthOnMobile ? "w-full sm:w-max" : "w-max"} ··· 96 96 compact?: boolean; 97 97 } & ButtonProps 98 98 >((props, ref) => { 99 + let { fullWidth, children, compact, ...buttonProps } = props; 99 100 return ( 100 101 <button 101 - {...props} 102 + {...buttonProps} 102 103 ref={ref} 103 - className={`m-0 h-max ${props.fullWidth ? "w-full" : "w-max"} ${props.compact ? "px-0" : "px-1"} 104 + className={`m-0 h-max ${fullWidth ? "w-full" : "w-max"} ${compact ? "px-0" : "px-1"} 104 105 bg-transparent text-base font-bold text-accent-contrast 105 106 flex gap-2 items-center justify-center shrink-0 106 107 hover:underline disabled:text-border 107 108 ${props.className} 108 109 `} 109 110 > 110 - {props.children} 111 + {children} 111 112 </button> 112 113 ); 113 114 });
+4 -4
components/HomeButton.tsx
··· 42 42 ) 43 43 return null; 44 44 return ( 45 - <button 45 + <ActionButton 46 46 onClick={async (e) => { 47 47 await addLeafletToHome(permission_token.id); 48 48 mutate((identity) => { ··· 66 66 text: "Leaflet added to your home!", 67 67 }); 68 68 }} 69 - > 70 - <ActionButton icon={<AddToHomeSmall />} label="Add to Home" /> 71 - </button> 69 + icon={<AddToHomeSmall />} 70 + label="Add to Home" 71 + /> 72 72 ); 73 73 };
+10 -1
components/Layout.tsx
··· 2 2 import { theme } from "tailwind.config"; 3 3 import { NestedCardThemeProvider } from "./ThemeManager/ThemeProvider"; 4 4 import { PopoverArrow } from "./Icons/PopoverArrow"; 5 + import { PopoverOpenContext } from "./Popover"; 6 + import { useState } from "react"; 5 7 6 8 export const Separator = (props: { classname?: string }) => { 7 9 return ( ··· 20 22 onOpenChange?: (o: boolean) => void; 21 23 asChild?: boolean; 22 24 }) => { 25 + let [open, setOpen] = useState(props.open || false); 23 26 return ( 24 - <DropdownMenu.Root onOpenChange={props.onOpenChange} open={props.open}> 27 + <DropdownMenu.Root 28 + onOpenChange={(o) => { 29 + setOpen(o); 30 + props.onOpenChange?.(o); 31 + }} 32 + open={props.open} 33 + > 25 34 <DropdownMenu.Trigger asChild={props.asChild}> 26 35 {props.trigger} 27 36 </DropdownMenu.Trigger>