Use Stitches on Avatar

This commit is contained in:
Kalle (Sendou) 2021-10-30 22:02:24 +03:00
parent 83f5bb3564
commit cf63f8d6a1

View File

@ -1,5 +1,27 @@
import { Avatar as MantineAvatar } from "@mantine/core";
import { stitchesStyled } from "stitches.config";
export function Avatar({ src }: { src: string }) {
return <MantineAvatar radius="lg" src={src} />;
return (
<S_Container>
<S_Avatar src={src} />
</S_Container>
);
}
const S_Container = stitchesStyled("div", {
"-webkit-tap-highlight-color": "transparent",
position: "relative",
userSelect: "none",
overflow: "hidden",
width: "38px",
minWidth: "38px",
height: "38px",
borderRadius: "16px",
});
const S_Avatar = stitchesStyled("img", {
objectFit: "cover",
width: "100%",
height: "100%",
display: "block",
});