diff --git a/package.json b/package.json index 7ae71682..1048e99a 100644 --- a/package.json +++ b/package.json @@ -36,6 +36,7 @@ "@types/styled-components": "^5.1.10", "@typescript-eslint/eslint-plugin": "^4.27.0", "@typescript-eslint/parser": "^4.27.0", + "classnames": "^2.3.1", "dayjs": "^1.10.5", "detect-browser": "^5.2.0", "eslint": "^7.28.0", diff --git a/src/components/common/ChannelIcon.tsx b/src/components/common/ChannelIcon.tsx index 8be9fe80..af245c3f 100644 --- a/src/components/common/ChannelIcon.tsx +++ b/src/components/common/ChannelIcon.tsx @@ -1,7 +1,7 @@ import { useContext } from "preact/hooks"; import { Hash } from "@styled-icons/feather"; -import IconBase, { IconBaseProps } from "./IconBase"; import { Channels } from "revolt.js/dist/api/objects"; +import { ImageIconBase, IconBaseProps } from "./IconBase"; import { AppContext } from "../../context/revoltjs/RevoltClient"; interface Props extends IconBaseProps { @@ -9,10 +9,10 @@ interface Props extends IconBaseProps, keyof Props>) { +export default function ChannelIcon(props: Props & Omit, keyof Props>) { const { client } = useContext(AppContext); - const { size, target, attachment, isServerChannel: server, animate, children, as, ...svgProps } = props; + const { size, target, attachment, isServerChannel: server, animate, children, as, ...imgProps } = props; const iconURL = client.generateFileURL(target?.icon ?? attachment, { max_side: 256 }, animate); const isServerChannel = server || target?.channel_type === 'TextChannel'; @@ -25,21 +25,18 @@ export default function ChannelIcon(props: Props & Omit + +