InfoTooltip.tsx 777 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. import React, { Component } from "react";
  2. import styled from "styled-components";
  3. type PropsType = {
  4. text: string;
  5. };
  6. type StateType = {
  7. showTooltip: boolean;
  8. };
  9. export default class InfoTooltip extends Component<PropsType, StateType> {
  10. state = {
  11. showTooltip: false,
  12. };
  13. render() {
  14. return (
  15. <StyledInfoTooltip>
  16. <i className="material-icons">help_outline</i>
  17. </StyledInfoTooltip>
  18. );
  19. }
  20. }
  21. const StyledInfoTooltip = styled.div`
  22. display: inline-block;
  23. position: relative;
  24. width: 26px;
  25. margin-right: 2px;
  26. > i {
  27. display: flex;
  28. align-items: center;
  29. position: absolute;
  30. top: -14px;
  31. font-size: 18px;
  32. right: -1px;
  33. color: #858faaaa;
  34. cursor: pointer;
  35. :hover {
  36. color: #aaaabb;
  37. }
  38. }
  39. `;