]> Untitled Git - lemmy-ui.git/blob - src/shared/components/icon.tsx
Change from using Link to NavLink. resolve #269
[lemmy-ui.git] / src / shared / components / icon.tsx
1 import { Component } from "inferno";
2
3 interface IconProps {
4   icon: string;
5   classes?: string;
6 }
7
8 export class Icon extends Component<IconProps, any> {
9   constructor(props: any, context: any) {
10     super(props, context);
11   }
12
13   render() {
14     return (
15       <svg class={`icon ${this.props.classes}`}>
16         <div class="sr-only">
17           <title>{this.props.icon}</title>
18         </div>
19         <use xlinkHref={`#icon-${this.props.icon}`}></use>
20       </svg>
21     );
22   }
23 }
24
25 export class Spinner extends Component<any, any> {
26   constructor(props: any, context: any) {
27     super(props, context);
28   }
29
30   render() {
31     return <Icon icon="spinner" classes="icon-spinner spin" />;
32   }
33 }