Yuki Takei 5 лет назад
Родитель
Сommit
0c7275cf49
1 измененных файлов с 10 добавлено и 2 удалено
  1. 10 2
      src/client/js/components/User/UserPicture.jsx

+ 10 - 2
src/client/js/components/User/UserPicture.jsx

@@ -4,6 +4,8 @@ import PropTypes from 'prop-types';
 
 
 import { userPageRoot } from '@commons/util/path-utils';
 import { userPageRoot } from '@commons/util/path-utils';
 
 
+import { UncontrolledTooltip } from 'reactstrap';
+
 const DEFAULT_IMAGE = '/images/icons/user.svg';
 const DEFAULT_IMAGE = '/images/icons/user.svg';
 
 
 // TODO UserComponent?
 // TODO UserComponent?
@@ -64,10 +66,16 @@ export default class UserPicture extends React.Component {
 
 
   withTooltip = (RootElm) => {
   withTooltip = (RootElm) => {
     const { user } = this.props;
     const { user } = this.props;
-    const title = `@${user.username}<br />${user.name}`;
+    const id = `user-picture-${Math.random().toString(32).substring(2)}`;
 
 
     return props => (
     return props => (
-      <RootElm data-toggle="tooltip" data-placement="bottom" data-html="true" title={title}>{props.children}</RootElm>
+      <>
+        <RootElm id={id}>{props.children}</RootElm>
+        <UncontrolledTooltip placement="bottom" target={id}>
+          @{user.username}<br />
+          {user.name}
+        </UncontrolledTooltip>
+      </>
     );
     );
   }
   }