EnxDev commented on code in PR #33256:
URL: https://github.com/apache/superset/pull/33256#discussion_r2064049661
##########
superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx:
##########
@@ -16,56 +16,60 @@
* specific language governing permissions and limitations
* under the License.
*/
-import { CSSProperties } from 'react';
+import { CSSProperties, KeyboardEvent, ReactNode } from 'react';
import { kebabCase } from 'lodash';
import { t } from '@superset-ui/core';
+import { ExclamationCircleOutlined } from '@ant-design/icons';
import { Tooltip, TooltipProps, TooltipPlacement } from './Tooltip';
export interface InfoTooltipWithTriggerProps {
label?: string;
tooltip?: TooltipProps['title'];
- icon?: string;
+ icon?: ReactNode;
onClick?: () => void;
placement?: TooltipPlacement;
- bsStyle?: string;
className?: string;
iconsStyle?: CSSProperties;
}
-export function InfoTooltipWithTrigger({
+export const InfoTooltipWithTrigger = ({
label,
tooltip,
- bsStyle,
onClick,
- icon = 'info-circle',
+ icon = <ExclamationCircleOutlined />,
className = 'text-muted',
placement = 'right',
- iconsStyle = {},
-}: InfoTooltipWithTriggerProps) {
- const iconClass = `fa fa-${icon} ${className} ${
- bsStyle ? `text-${bsStyle}` : ''
- }`;
+ iconsStyle = { fontSize: 12 },
Review Comment:
I would like to allow flexibility in choosing the icon size.
If I include the 3 icons that can be used inside the InfoTooltipWithTrigger
component, I will allow the user to choose the icon (from the three available)
through props, as well as the size, which can be expressed in px or sizes like
s, m, l, etc.
At that point, I will directly apply the style inside the component to
adjust the size.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]