40 lines
1.4 KiB
TypeScript
40 lines
1.4 KiB
TypeScript
import { IconButton, IconButtonProps, SxProps, Theme, useTheme } from "@mui/material";
|
|
|
|
|
|
interface Props {
|
|
onClick?: IconButtonProps["onClick"];
|
|
sx?: SxProps<Theme>;
|
|
size?: string | number;
|
|
}
|
|
|
|
export function WalletButton({ onClick, size = 36, sx }: Props) {
|
|
const theme = useTheme();
|
|
|
|
return (
|
|
<IconButton
|
|
onClick={onClick}
|
|
sx={{
|
|
height: size,
|
|
width: size,
|
|
p: 0,
|
|
borderRadius: "6px",
|
|
backgroundColor: theme.palette.background.default,
|
|
color: theme.palette.gray.main,
|
|
"&:hover": {
|
|
color: theme.palette.background.default,
|
|
backgroundColor: theme.palette.gray.main,
|
|
},
|
|
"&:active": {
|
|
backgroundColor: theme.palette.purple.main,
|
|
color: "white",
|
|
},
|
|
...sx,
|
|
}}
|
|
>
|
|
<svg xmlns="http://www.w3.org/2000/svg" width="100%" height="100%" viewBox="0 0 36 37" fill="none">
|
|
<path d="M26.571 16.051v-5c0-.789-.64-1.428-1.428-1.428H9.429c-.79 0-1.429.64-1.429 1.428v14.286c0 .789.64 1.428 1.429 1.428h15.714c.789 0 1.428-.64 1.428-1.428v-5m1.33-5h-7.044a2.857 2.857 0 0 0 0 5.714h7.044a.099.099 0 0 0 .099-.099v-5.516a.1.1 0 0 0-.099-.1Z" stroke="currentColor" strokeWidth="1.5" />
|
|
</svg>
|
|
</IconButton>
|
|
);
|
|
}
|