File tree Expand file tree Collapse file tree 1 file changed +22
-27
lines changed Expand file tree Collapse file tree 1 file changed +22
-27
lines changed Original file line number Diff line number Diff line change 1
1
import React , { ReactNode , useState } from "react"
2
2
import styled from "@emotion/styled"
3
- import { Box } from "@chakra-ui/react"
3
+ import { Box , calc } from "@chakra-ui/react"
4
4
import * as utils from "../utils/isMobile"
5
5
6
- const Content = styled . div `
7
- text-align: center;
8
- white-space: normal;
9
- width: 200px;
10
- color: ${ ( { theme } ) => theme . colors . text } ;
11
- background-color: ${ ( { theme } ) => theme . colors . background } ;
12
- box-shadow: ${ ( { theme } ) => theme . colors . tableBoxShadow } ;
13
- position: absolute;
14
- z-index: 10;
15
- padding: 1rem 0.5rem;
16
- text-transform: none;
17
- font-size: ${ ( { theme } ) => theme . fontSizes . s } ;
18
- font-weight: 500;
19
- cursor: default;
20
- border-radius: 4px;
21
- bottom: calc(100% + 1rem);
22
- left: 25%;
23
- bottom: 125%;
24
- transform: translateX(-50%);
25
- @media (max-width: ${ ( { theme } ) => theme . breakpoints . m } ) {
26
- width: 140px;
27
- }
28
- `
29
-
30
6
const Arrow = styled . span `
31
7
position: absolute;
32
8
bottom: -0.5rem;
@@ -74,10 +50,29 @@ const Tooltip: React.FC<IProps> = ({ content, children }) => {
74
50
>
75
51
{ children }
76
52
{ isVisible && (
77
- < Content >
53
+ < Box
54
+ textAlign = "center"
55
+ whiteSpace = "normal"
56
+ w = { { base : "140px" , md : "200px" } }
57
+ color = "text"
58
+ bg = "background"
59
+ boxShadow = "tableBoxShadow"
60
+ position = "absolute"
61
+ zIndex = "docked"
62
+ py = { 4 }
63
+ px = { 2 }
64
+ textTransform = "none"
65
+ fontSize = "sm"
66
+ fontWeight = "medium"
67
+ cursor = "default"
68
+ borderRadius = "base"
69
+ bottom = "125%"
70
+ left = "25%"
71
+ transform = "translateX(-50%)"
72
+ >
78
73
< Arrow />
79
74
{ content }
80
- </ Content >
75
+ </ Box >
81
76
) }
82
77
</ Box >
83
78
</ >
You can’t perform that action at this time.
0 commit comments