Advertisement
Guest User

Untitled

a guest
Jun 18th, 2019
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.28 KB | None | 0 0
  1. import classNames from "classnames";
  2. import * as React from "react";
  3.  
  4. import * as styles from "./index.scss";
  5.  
  6. class ToolTip extends React.Component<IProps> {
  7. public render = () => {
  8. const { className, content, children} = this.props;
  9.  
  10. return (
  11. <span className={stylesContext(styles.root)}>
  12. {children}
  13. <span
  14. className={stylesContext(
  15. styles.content,
  16. className
  17. )}
  18. >
  19. {content}
  20. </span>
  21. </span>
  22. );
  23. };
  24. }
  25.  
  26. .root {
  27. position: relative;
  28. display: flex;
  29. justify-content: center;
  30.  
  31. .content {
  32. display: none;
  33. color: $white1;
  34. max-width: 400px;
  35. min-width: 65px;
  36. position: absolute;
  37. left: 50%;
  38. transform: translate(-20%, -100%);
  39. padding: 8px 16px;
  40. border-radius: 5px;
  41. box-shadow: 0 -2px 10px 7px rgba(0, 0, 0, 0.2);
  42. background-color: $color;
  43. top: -55%;
  44. font-style: normal;
  45. margin-left: -5px;
  46. margin-bottom: -5px;
  47. font-size: $font-size-small;
  48. font-weight: $font-weight-regular;
  49. box-sizing: border-box;
  50. line-height: 19px;
  51. text-align: left;
  52.  
  53. &::after {
  54. top: 100%;
  55. left: 20%;
  56. margin-left: -5px;
  57. }
  58. }
  59. }
  60.  
  61. <ToolTip content={config.tooltip}>
  62. <QuestionIcon />
  63. </ToolTip>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement