a tool for shared writing and social publishing

pull out unused button props

+18 -8
+18 -8
components/ActionBar/ActionButton.tsx
··· 8 8 type ButtonProps = Omit<JSX.IntrinsicElements["button"], "content">; 9 9 10 10 export const ActionButton = ( 11 - props: ButtonProps & { 11 + _props: ButtonProps & { 12 12 id?: string; 13 13 icon: React.ReactNode; 14 14 label: React.ReactNode; ··· 20 20 labelOnMobile?: boolean; 21 21 }, 22 22 ) => { 23 - let { id, icon, label, primary, secondary, nav, ...buttonProps } = props; 23 + let { 24 + id, 25 + icon, 26 + label, 27 + primary, 28 + secondary, 29 + nav, 30 + labelOnMobile, 31 + subtext, 32 + className, 33 + ...buttonProps 34 + } = _props; 24 35 let sidebar = useContext(SidebarContext); 25 36 let inOpenPopover = useContext(PopoverOpenContext); 26 37 useEffect(() => { ··· 31 42 }; 32 43 } 33 44 }, [sidebar, inOpenPopover]); 34 - 45 + 35 46 let showLabelOnMobile = 36 - props.labelOnMobile !== false && 37 - (props.primary || props.secondary || props.nav); 47 + labelOnMobile !== false && (primary || secondary || nav); 38 48 39 49 return ( 40 50 <button ··· 54 64 ? "border-transparent text-secondary sm:hover:border-border justify-start!" 55 65 : "border-transparent text-accent-contrast sm:hover:border-accent-contrast" 56 66 } 57 - ${props.className} 67 + ${className} 58 68 `} 59 69 > 60 70 <div className="shrink-0">{icon}</div> ··· 62 72 className={`flex flex-col pr-1 leading-snug max-w-full min-w-0 ${sidebar.open ? "block" : showLabelOnMobile ? "sm:hidden block" : "hidden"}`} 63 73 > 64 74 <div className="truncate text-left pt-[1px]">{label}</div> 65 - {props.subtext && ( 75 + {subtext && ( 66 76 <div className="text-xs text-tertiary font-normal text-left"> 67 - {props.subtext} 77 + {subtext} 68 78 </div> 69 79 )} 70 80 </div>