2021-06-19 07:34:53 -04:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2021-06-19 10:29:04 -04:00
|
|
|
interface IconModifiers {
|
|
|
|
square?: boolean
|
|
|
|
}
|
|
|
|
|
|
|
|
export default styled.svg<IconModifiers>`
|
2021-06-24 11:22:45 -04:00
|
|
|
flex-shrink: 0;
|
|
|
|
|
2021-06-19 07:34:53 -04:00
|
|
|
img {
|
|
|
|
width: 100%;
|
|
|
|
height: 100%;
|
|
|
|
object-fit: cover;
|
|
|
|
|
|
|
|
${ props => !props.square && css`
|
|
|
|
border-radius: 50%;
|
|
|
|
` }
|
|
|
|
}
|
|
|
|
`;
|
2021-06-19 10:29:04 -04:00
|
|
|
|
|
|
|
export const ImageIconBase = styled.img<IconModifiers>`
|
2021-06-24 11:22:45 -04:00
|
|
|
flex-shrink: 0;
|
2021-06-19 10:29:04 -04:00
|
|
|
object-fit: cover;
|
|
|
|
|
|
|
|
${ props => !props.square && css`
|
|
|
|
border-radius: 50%;
|
|
|
|
` }
|
|
|
|
`;
|