add props to tooptip component

This commit is contained in:
hiroshisuga 2023-04-03 17:13:54 +09:00 committed by GitHub
parent f6d401b502
commit 58ef3c6a5a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -57,9 +57,19 @@ class Tooltip extends Component {
const {
position,
title,
delay,
placement,
} = this.props;
const { animations } = Settings.application;
const overridePlacement = placement ? placement : position;
let overrideDelay;
if (animations) {
overrideDelay = delay ? [delay, ANIMATION_DELAY[1]] : ANIMATION_DELAY;
} else {
overrideDelay = delay ? [delay, 0] : [ANIMATION_DELAY[0], 0];
}
const options = {
aria: null,
@ -69,14 +79,14 @@ class Tooltip extends Component {
arrow: roundArrow,
boundary: 'window',
content: title,
delay: animations ? ANIMATION_DELAY : [ANIMATION_DELAY[0], 0],
delay: overrideDelay,
duration: animations ? ANIMATION_DURATION : 0,
interactive: true,
interactiveBorder: 10,
onShow: this.onShow,
onHide: this.onHide,
offset: TIP_OFFSET,
placement: position,
placement: overridePlacement,
touch: 'hold',
theme: 'bbbtip',
multiple: false,