-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a59886b
commit 37937b8
Showing
11 changed files
with
149 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
61 changes: 61 additions & 0 deletions
61
packages/browser-wallet/src/popup/popupX/shared/Tooltip/Tooltip.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
.tooltip-x { | ||
position: relative; | ||
|
||
&:hover { | ||
.tooltip-x_text { | ||
visibility: visible; | ||
} | ||
} | ||
|
||
&_text { | ||
display: flex; | ||
flex-direction: column; | ||
gap: rem(6px); | ||
visibility: hidden; | ||
background-color: $color-tooltip-bg; | ||
text-wrap: nowrap; | ||
text-align: left; | ||
border-radius: 6px; | ||
padding: rem(12px); | ||
position: absolute; | ||
z-index: 1; | ||
left: -108px; | ||
top: 28px; | ||
|
||
&::after { | ||
content: ''; | ||
position: absolute; | ||
border-left: 8px solid $color-tooltip-bg; | ||
border-right: 6px solid $color-tooltip-bg; | ||
border-top: 8px solid $color-tooltip-bg; | ||
border-bottom: 6px solid $color-tooltip-bg; | ||
border-top-left-radius: 1px; | ||
} | ||
|
||
&.top { | ||
top: 100%; | ||
|
||
&::after { | ||
top: -5%; | ||
left: 50%; | ||
transform: rotate(45deg) skew(10deg, 10deg); | ||
} | ||
} | ||
|
||
&.bottom { | ||
top: unset; | ||
left: unset; | ||
|
||
&::after { | ||
top: 90%; | ||
left: 50%; | ||
transform: rotate(225deg) skew(10deg, 10deg); | ||
} | ||
} | ||
|
||
.text__main_medium, | ||
.capture__main_small { | ||
color: $color-black; | ||
} | ||
} | ||
} |
27 changes: 27 additions & 0 deletions
27
packages/browser-wallet/src/popup/popupX/shared/Tooltip/Tooltip.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { ReactNode } from 'react'; | ||
import clsx from 'clsx'; | ||
import Text from '@popup/popupX/shared/Text'; | ||
|
||
export default function Tooltip({ | ||
title, | ||
text, | ||
className, | ||
position = 'top', | ||
children, | ||
}: { | ||
title?: string; | ||
text?: string; | ||
className?: string; | ||
position?: 'top' | 'bottom'; | ||
children: ReactNode; | ||
}) { | ||
return ( | ||
<div className={clsx('tooltip-x', className)}> | ||
<span className={clsx('tooltip-x_text', position)}> | ||
<Text.MainMedium>{title}</Text.MainMedium> | ||
<Text.Capture>{text}</Text.Capture> | ||
</span> | ||
{children} | ||
</div> | ||
); | ||
} |
1 change: 1 addition & 0 deletions
1
packages/browser-wallet/src/popup/popupX/shared/Tooltip/index.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
export { default } from './Tooltip'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters