feat: Add tooltip with icon for embedding scenes (#2532)

Co-authored-by: dwelle <luzar.david@gmail.com>
This commit is contained in:
Kartik Prajapati
2020-12-14 18:54:54 +05:30
committed by GitHub
parent 4b32c03994
commit 60864ace54
8 changed files with 78 additions and 76 deletions

View File

@ -5,11 +5,27 @@ import React from "react";
type TooltipProps = {
children: React.ReactNode;
label: string;
position?: "above" | "below";
long?: boolean;
};
export const Tooltip = ({ children, label }: TooltipProps) => (
export const Tooltip = ({
children,
label,
position = "below",
long = false,
}: TooltipProps) => (
<div className="Tooltip">
<span className="Tooltip__label">{label}</span>
<span
className={
position === "above"
? "Tooltip__label Tooltip__label--above"
: "Tooltip__label Tooltip__label--below"
}
style={{ width: long ? "50ch" : "10ch" }}
>
{label}
</span>
{children}
</div>
);