2023-02-09 17:41:23 +00:00
|
|
|
import { Typography } from "@material-ui/core";
|
|
|
|
import { makeStyles } from "@saleor/macaw-ui";
|
|
|
|
import { HTMLProps, ReactNode } from "react";
|
|
|
|
import clsx from "clsx";
|
|
|
|
|
2023-02-14 11:44:26 +00:00
|
|
|
const useStyles = makeStyles({
|
|
|
|
appIconContainer: {
|
|
|
|
background: "rgb(58, 86, 199)",
|
|
|
|
display: "flex",
|
|
|
|
flexDirection: "column",
|
|
|
|
justifyContent: "center",
|
|
|
|
alignItems: "center",
|
|
|
|
borderRadius: "50%",
|
|
|
|
color: "#fff",
|
|
|
|
width: 50,
|
|
|
|
height: 50,
|
|
|
|
},
|
2023-02-09 17:41:23 +00:00
|
|
|
});
|
|
|
|
|
|
|
|
type Props = HTMLProps<HTMLDivElement> & {
|
|
|
|
theme: string;
|
|
|
|
text?: string;
|
|
|
|
icon?: ReactNode;
|
|
|
|
};
|
|
|
|
|
|
|
|
export function AppIcon({ className, children, text, icon, ...props }: Props) {
|
|
|
|
const styles = useStyles();
|
|
|
|
|
|
|
|
return (
|
|
|
|
<div className={clsx(styles.appIconContainer, className)} {...props}>
|
|
|
|
{text && <Typography variant="h2">{text}</Typography>}
|
|
|
|
{icon && icon}
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
}
|