mirror of
https://github.com/LemmyNet/lemmy-ui.git
synced 2024-11-02 02:29:59 +00:00
eed07b66aa
* Fixing too many large spinners * Re-organized components folder. - Cleaned up spans. Fixes #173 - Fixes #320 * Fixing miscolored edit
42 lines
804 B
TypeScript
42 lines
804 B
TypeScript
import { Component } from "inferno";
|
|
|
|
interface IconProps {
|
|
icon: string;
|
|
classes?: string;
|
|
}
|
|
|
|
export class Icon extends Component<IconProps, any> {
|
|
constructor(props: any, context: any) {
|
|
super(props, context);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<svg class={`icon ${this.props.classes}`}>
|
|
<use xlinkHref={`#icon-${this.props.icon}`}></use>
|
|
<div class="sr-only">
|
|
<title>{this.props.icon}</title>
|
|
</div>
|
|
</svg>
|
|
);
|
|
}
|
|
}
|
|
|
|
interface SpinnerProps {
|
|
large?: boolean;
|
|
}
|
|
|
|
export class Spinner extends Component<SpinnerProps, any> {
|
|
constructor(props: any, context: any) {
|
|
super(props, context);
|
|
}
|
|
|
|
render() {
|
|
return (
|
|
<Icon
|
|
icon="spinner"
|
|
classes={`spin ${this.props.large && "spinner-large"}`}
|
|
/>
|
|
);
|
|
}
|
|
}
|