Uniform rendering of tooltips for repository badges (#1698)

Co-authored-by: René Pfeuffer <rene.pfeuffer@cloudogu.com>
This commit is contained in:
Florian Scholdei
2021-06-15 09:29:24 +02:00
committed by GitHub
parent 965b5dbced
commit 58a8232aa9
6 changed files with 177 additions and 124 deletions

View File

@@ -23,20 +23,23 @@
*/
import React, { FC } from "react";
import Tag from "../Tag";
import { Color, Size } from "../styleConstants";
import Tooltip from "../Tooltip";
import Tag from "../Tag";
type Props = {
color?: Color;
title?: string;
title: string;
onClick?: () => void;
size?: Size;
};
const RepositoryFlag: FC<Props> = ({ children, size = "small", ...props }) => (
<Tag size={size} {...props}>
{children}
</Tag>
const RepositoryFlag: FC<Props> = ({ children, title, size = "small", ...props }) => (
<Tooltip location="bottom" message={title}>
<Tag size={size} {...props}>
{children}
</Tag>
</Tooltip>
);
export default RepositoryFlag;