diff --git a/lib/components/AvatarButton.tsx b/lib/components/AvatarButton.tsx index 6c79b4b..288973b 100644 --- a/lib/components/AvatarButton.tsx +++ b/lib/components/AvatarButton.tsx @@ -1,14 +1,21 @@ import { Avatar, IconButton, IconButtonProps, Typography, useTheme } from "@mui/material"; import { deepmerge } from "@mui/utils"; - +import { ForwardRefExoticComponent, RefAttributes } from "react"; +import { LinkProps } from "react-router-dom"; -export function AvatarButton(props: IconButtonProps) { + +type Props = IconButtonProps & { + component?: ForwardRefExoticComponent>; + to?: string; +}; + +export function AvatarButton(props: Props) { const theme = useTheme(); return ( diff --git a/lib/components/BurgerButton.tsx b/lib/components/BurgerButton.tsx index b693114..fd4f558 100644 --- a/lib/components/BurgerButton.tsx +++ b/lib/components/BurgerButton.tsx @@ -1,31 +1,34 @@ -import { IconButton, IconButtonProps, SxProps, Theme, useTheme } from "@mui/material"; +import { IconButton, IconButtonProps, useTheme } from "@mui/material"; +import { ForwardRefExoticComponent, RefAttributes } from "react"; +import { LinkProps } from "react-router-dom"; +import { deepmerge } from "@mui/utils"; -interface Props { - onClick?: IconButtonProps["onClick"]; - sx?: SxProps; - color?: string; -} +type Props = IconButtonProps & { + component?: ForwardRefExoticComponent>; + to?: string; +}; -export function BurgerButton({ onClick, sx, color = "white" }: Props) { +export function BurgerButton(props: Props) { const theme = useTheme(); return ( diff --git a/lib/components/CloseButton.tsx b/lib/components/CloseButton.tsx index bcc1a5b..2fdbe9a 100644 --- a/lib/components/CloseButton.tsx +++ b/lib/components/CloseButton.tsx @@ -1,30 +1,27 @@ -import { IconButton, IconButtonProps, SxProps, Theme, useTheme } from "@mui/material"; +import { IconButton, IconButtonProps, useTheme } from "@mui/material"; +import { deepmerge } from "@mui/utils"; -interface Props { - onClick?: IconButtonProps["onClick"]; - sx?: SxProps; -} - -export function CloseButton({ onClick, sx }: Props) { +export function CloseButton(props: IconButtonProps) { const theme = useTheme(); return ( diff --git a/lib/components/CloseButtonSmall.tsx b/lib/components/CloseButtonSmall.tsx index 8acf4b8..beeda8b 100644 --- a/lib/components/CloseButtonSmall.tsx +++ b/lib/components/CloseButtonSmall.tsx @@ -1,30 +1,27 @@ -import { IconButton, IconButtonProps, SxProps, Theme, useTheme } from "@mui/material"; +import { IconButton, IconButtonProps, useTheme } from "@mui/material"; +import { deepmerge } from "@mui/utils"; -interface Props { - onClick?: IconButtonProps["onClick"]; - sx?: SxProps; -} - -export function CloseButtonSmall({ onClick, sx }: Props) { +export function CloseButtonSmall(props: IconButtonProps) { const theme = useTheme(); return ( diff --git a/lib/components/WalletButton.tsx b/lib/components/WalletButton.tsx index e8bc599..c32eb1f 100644 --- a/lib/components/WalletButton.tsx +++ b/lib/components/WalletButton.tsx @@ -1,35 +1,37 @@ -import { IconButton, IconButtonProps, SxProps, Theme, useTheme } from "@mui/material"; +import { IconButton, IconButtonProps, useTheme } from "@mui/material"; +import { ForwardRefExoticComponent, RefAttributes } from "react"; +import { LinkProps } from "react-router-dom"; +import { deepmerge } from "@mui/utils"; -interface Props { - onClick?: IconButtonProps["onClick"]; - sx?: SxProps; - size?: string | number; -} +type Props = IconButtonProps & { + component?: ForwardRefExoticComponent>; + to?: string; +}; -export function WalletButton({ onClick, size = 36, sx }: Props) { +export function WalletButton(props: Props) { const theme = useTheme(); return ( diff --git a/package.json b/package.json index e2ceeff..716b90b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@frontend/kitui", - "version": "1.0.33", + "version": "1.0.35", "description": "test", "main": "./dist/index.js", "module": "./dist/index.js", @@ -49,6 +49,7 @@ "eslint-plugin-react-refresh": "^0.4.3", "eslint": "^8.45.0", "react-dom": "^18.2.0", + "react-router-dom": "^6.15.0", "react-syntax-highlighter": "^15.5.0", "react": "^18.2.0", "typescript": "^5.0.2", @@ -62,6 +63,7 @@ "@mui/icons-material": "^5.14.3", "@mui/material": "^5.14.4", "axios": "^1.4.0", + "react-router-dom": "^6.15.0", "react": "^18.2.0", "zustand": "^4.3.8" } diff --git a/yarn.lock b/yarn.lock index 9a0246b..1e3d36b 100644 --- a/yarn.lock +++ b/yarn.lock @@ -681,6 +681,11 @@ resolved "https://registry.yarnpkg.com/@popperjs/core/-/core-2.11.8.tgz#6b79032e760a0899cd4204710beede972a3a185f" integrity sha512-P1st0aksCrn9sGZhp8GMYwBnQsbvAWsZAX44oXNNvLHGqAOcoVxmjZiohstwQ7SqKnbR47akdNi+uleWD8+g6A== +"@remix-run/router@1.8.0": + version "1.8.0" + resolved "https://registry.yarnpkg.com/@remix-run/router/-/router-1.8.0.tgz#e848d2f669f601544df15ce2a313955e4bf0bafc" + integrity sha512-mrfKqIHnSZRyIzBcanNJmVQELTnX+qagEDlcKO90RgRBVOZGSGvZKeDihTRfWcqoDn5N/NkUcwWTccnpN18Tfg== + "@rollup/pluginutils@^5.0.2": version "5.0.3" resolved "https://registry.yarnpkg.com/@rollup/pluginutils/-/pluginutils-5.0.3.tgz#183126d69aeb1cfa23401d5a71cb4b8c16c4a4e0" @@ -2139,6 +2144,21 @@ react-refresh@^0.14.0: resolved "https://registry.yarnpkg.com/react-refresh/-/react-refresh-0.14.0.tgz#4e02825378a5f227079554d4284889354e5f553e" integrity sha512-wViHqhAd8OHeLS/IRMJjTSDHF3U9eWi62F/MledQGPdJGDhodXJ9PBLNGr6WWL7qlH12Mt3TyTpbS+hGXMjCzQ== +react-router-dom@^6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/react-router-dom/-/react-router-dom-6.15.0.tgz#6da7db61e56797266fbbef0d5e324d6ac443ee40" + integrity sha512-aR42t0fs7brintwBGAv2+mGlCtgtFQeOzK0BM1/OiqEzRejOZtpMZepvgkscpMUnKb8YO84G7s3LsHnnDNonbQ== + dependencies: + "@remix-run/router" "1.8.0" + react-router "6.15.0" + +react-router@6.15.0: + version "6.15.0" + resolved "https://registry.yarnpkg.com/react-router/-/react-router-6.15.0.tgz#bf2cb5a4a7ed57f074d4ea88db0d95033f39cac8" + integrity sha512-NIytlzvzLwJkCQj2HLefmeakxxWHWAP+02EGqWEZy+DgfHHKQMUoBBjUQLOtFInBMhWtb3hiUy6MfFgwLjXhqg== + dependencies: + "@remix-run/router" "1.8.0" + react-syntax-highlighter@^15.5.0: version "15.5.0" resolved "https://registry.yarnpkg.com/react-syntax-highlighter/-/react-syntax-highlighter-15.5.0.tgz#4b3eccc2325fa2ec8eff1e2d6c18fa4a9e07ab20"