From 9aed5bb5c183b85bfa859a4ba5f8234f1c0ea028 Mon Sep 17 00:00:00 2001 From: Mark McDowall Date: Thu, 26 Jan 2023 20:26:12 -0800 Subject: [PATCH] Sync Popover with upstream --- frontend/src/Artist/Index/Table/ArtistStatusCell.css | 1 + frontend/src/Components/Tooltip/Popover.js | 8 +++++++- frontend/src/Helpers/Props/TooltipPosition.ts | 8 ++++++++ 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 frontend/src/Helpers/Props/TooltipPosition.ts diff --git a/frontend/src/Artist/Index/Table/ArtistStatusCell.css b/frontend/src/Artist/Index/Table/ArtistStatusCell.css index a2d440998..a4cb08a22 100644 --- a/frontend/src/Artist/Index/Table/ArtistStatusCell.css +++ b/frontend/src/Artist/Index/Table/ArtistStatusCell.css @@ -13,4 +13,5 @@ .statusIcon { width: 20px !important; + text-align: center; } diff --git a/frontend/src/Components/Tooltip/Popover.js b/frontend/src/Components/Tooltip/Popover.js index 9ce73cf08..1fe92fcbf 100644 --- a/frontend/src/Components/Tooltip/Popover.js +++ b/frontend/src/Components/Tooltip/Popover.js @@ -1,5 +1,6 @@ import PropTypes from 'prop-types'; import React from 'react'; +import { tooltipPositions } from 'Helpers/Props'; import Tooltip from './Tooltip'; import styles from './Popover.css'; @@ -30,8 +31,13 @@ function Popover(props) { } Popover.propTypes = { + className: PropTypes.string, + bodyClassName: PropTypes.string, + anchor: PropTypes.node.isRequired, title: PropTypes.string.isRequired, - body: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired + body: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired, + position: PropTypes.oneOf(tooltipPositions.all), + canFlip: PropTypes.bool }; export default Popover; diff --git a/frontend/src/Helpers/Props/TooltipPosition.ts b/frontend/src/Helpers/Props/TooltipPosition.ts new file mode 100644 index 000000000..7a9351ac6 --- /dev/null +++ b/frontend/src/Helpers/Props/TooltipPosition.ts @@ -0,0 +1,8 @@ +enum TooltipPosition { + Top = 'top', + Right = 'right', + Bottom = 'bottom', + Left = 'left', +} + +export default TooltipPosition;