mirror of
https://github.com/stoatchat/for-legacy-web.git
synced 2026-03-07 09:25:27 +00:00
Port and re-write icon code.
This commit is contained in:
22
src/components/common/IconBase.tsx
Normal file
22
src/components/common/IconBase.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
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;
|
||||
}
|
||||
|
||||
export default styled.svg<{ square?: boolean }>`
|
||||
img {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
object-fit: cover;
|
||||
|
||||
${ props => !props.square && css`
|
||||
border-radius: 50%;
|
||||
` }
|
||||
}
|
||||
`;
|
||||
Reference in New Issue
Block a user