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";
|
2021-03-21 18:05:24 +01:00
|
|
|
import selectedTheme from "../lib/theme";
|
2020-07-08 19:36:36 +02:00
|
|
|
|
2021-03-21 18:05:24 +01:00
|
|
|
interface IIconProps {
|
|
|
|
name: string;
|
|
|
|
size?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export const Icon = ({ name, size }: IIconProps) => {
|
|
|
|
|
|
|
|
let IconContainer = styled.i`
|
2020-07-08 19:36:36 +02:00
|
|
|
font-family: "Material Icons";
|
|
|
|
font-weight: normal;
|
|
|
|
font-style: normal;
|
2021-03-21 18:05:24 +01:00
|
|
|
font-size: ${size ? size : "24px"};
|
|
|
|
color: ${selectedTheme.mainColor};
|
2020-07-08 19:36:36 +02:00
|
|
|
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
|
|
|
return <IconContainer>{name}</IconContainer>;
|
|
|
|
};
|
|
|
|
|
2021-03-21 18:05:24 +01:00
|
|
|
export default Icon;
|