Changed a component from using function compontent

This commit is contained in:
James Ritchie
2022-03-25 10:12:10 +00:00
parent 5ce0197ea4
commit 6a2c11cdc2
2 changed files with 10 additions and 8 deletions
+9 -7
View File
@@ -1,12 +1,14 @@
import { FunctionComponent } from "react";
export type ShortcutIconProps = {
children: React.ReactNode;
className?: string;
};
export const ShortcutIcon: FunctionComponent<{ className?: string }> = ({
className,
children,
}) => {
export function ShortcutIcon({ className, children }: ShortcutIconProps) {
return (
<span className={`flex items-center justify-center rounded ${className}`}>
<span
className={`flex items-center justify-center rounded ${className ?? ""}`}
>
{children}
</span>
);
};
}
+1 -1
View File
@@ -34,7 +34,7 @@ export function ToolTip({ children, className, arrow }: ToolTipProps) {
transition={{ duration: 0.2 }}
whileHover={{ scale: 1, opacity: 1 }}
whileTap={{
scale: 1.05,
scale: 1,
}}
onMouseOver={() => setIsShown(true)}
onMouseOut={() => setIsShown(false)}