aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/components/TooltipComponent.tsx
blob: 0e13c63c281522e2902ae03ed6fdbb6f0c846e1c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import * as React from "react";

export interface TooltipProps {
    text: string;
    show: boolean;
}

export interface TooltipState {

}

class TooltipComponent extends React.Component<TooltipProps, TooltipState> {

    constructor(props: TooltipProps) {
        super(props);
    }

    render(): React.ReactElement {
        const style: React.CSSProperties = {
            display: this.props.show ? "flex" : "none",
            position: "absolute",
        }

        return (
            <span style={style}
                className={"sponsorBlockTooltip"} >
                <span className="sponsorBlockTooltipText">
                    {this.props.text}
                </span>
            </span>
        );
    }
}

export default TooltipComponent;