dashboard/src/components/icon.tsx

37 lines
863 B
TypeScript
Raw Normal View History

2020-07-09 16:22:18 +02:00
import React from "react";
2020-07-08 19:36:36 +02:00
import styled from "styled-components";
import selectedTheme from "./themeManager";
2020-07-09 16:22:18 +02:00
export const RawIcon = styled.i`
2020-07-08 19:36:36 +02:00
font-family: "Material Icons";
font-weight: normal;
font-style: normal;
display: inline-block;
line-height: 1;
text-transform: none;
letter-spacing: normal;
word-wrap: normal;
white-space: nowrap;
direction: ltr;
-webkit-font-smoothing: antialiased;
text-rendering: optimizeLegibility;
-moz-osx-font-smoothing: grayscale;
font-feature-settings: "liga";
`;
2020-07-09 16:22:18 +02:00
interface IIconProps {
name: string;
size?: string;
}
export const ComponentIcon = ({ name, size }: IIconProps) => {
let IconContainer = styled(RawIcon)`
font-size: ${size ? size : "24px"};
text-color: ${selectedTheme.mainColor};
`;
return <IconContainer>{name}</IconContainer>;
};
export default ComponentIcon;