Skip to content
Snippets Groups Projects
IconBase.tsx 659 B
Newer Older
insert's avatar
insert committed
import { Attachment } from "revolt.js/dist/api/objects";
import styled, { css } from "styled-components";

export interface IconBaseProps<T> {
    target?: T;
    attachment?: Attachment;

    size: number;
    animate?: boolean;
}

insert's avatar
insert committed
interface IconModifiers {
    square?: boolean
}

export default styled.svg<IconModifiers>`
insert's avatar
insert committed
    img {
        width: 100%;
        height: 100%;
        object-fit: cover;

        ${ props => !props.square && css`
            border-radius: 50%;
        ` }
    }
`;
insert's avatar
insert committed

export const ImageIconBase = styled.img<IconModifiers>`
    object-fit: cover;

    ${ props => !props.square && css`
        border-radius: 50%;
    ` }
`;