-
+
+
+
+
+
+ //TODO: remove mock message later
+
+
+
+
+
+
+
+
+
+
+ //TODO: remove mock message later
+
+
+
+
+
+
+
+
+
+
-
+
+
-
- code->renderCode
+
+
+
+
+
- >
+ {code |> renderCode}
+
,
);
}
diff --git a/scan/src/reusable/CTooltip.re b/scan/src/reusable/CTooltip.re
index 7cd11d0bae..4bbcd19e11 100644
--- a/scan/src/reusable/CTooltip.re
+++ b/scan/src/reusable/CTooltip.re
@@ -2,7 +2,9 @@ type placement =
| Left
| Right
| Top
- | Bottom;
+ | Bottom
+ | BottomLeft
+ | BottomRight;
module Styles = {
open Css;
@@ -11,7 +13,9 @@ module Styles = {
cursor(`pointer),
position(`relative),
display(`block),
- hover([selector("> div:nth-child(1)", [opacity(1.), pointerEvents(`unset)])]),
+ hover([
+ selector("> div:nth-child(1)", [opacity(1.), zIndex(99), pointerEvents(`unset)]),
+ ]),
]);
let tooltipItem = width_ =>
style([
@@ -32,6 +36,7 @@ module Styles = {
position(`absolute),
border(`px(5), `solid, Colors.transparent),
]),
+ Media.mobile([padding(`px(12)), fontSize(`px(12))]),
]);
let placement =
@@ -83,13 +88,130 @@ module Styles = {
top(`px(-10)),
borderBottomColor(Colors.gray7),
]),
+ ])
+ | BottomLeft =>
+ style([
+ top(`percent(100.)),
+ left(`percent(50.)),
+ transform(`translateX(`percent(-30.))),
+ before([
+ transform(`translateX(`percent(-50.))),
+ left(`percent(30.)),
+ top(`px(-10)),
+ borderBottomColor(Colors.gray7),
+ ]),
+ ])
+ | BottomRight =>
+ style([
+ top(`percent(100.)),
+ left(`percent(50.)),
+ transform(`translateX(`percent(-70.))),
+ before([
+ transform(`translateX(`percent(-70.))),
+ left(`percent(70.)),
+ top(`px(-10)),
+ borderBottomColor(Colors.gray7),
+ ]),
+ ]);
+
+ let placementSm =
+ fun
+ | Left =>
+ style([
+ Media.mobile([
+ top(`percent(50.)),
+ right(`percent(100.)),
+ transform(`translateY(`percent(-50.))),
+ before([
+ top(`percent(50.)),
+ transform(`translateY(`percent(-50.))),
+ right(`px(-10)),
+ borderLeftColor(Colors.gray7),
+ ]),
+ ]),
+ ])
+ | Right =>
+ style([
+ Media.mobile([
+ top(`percent(50.)),
+ left(`percent(100.)),
+ transform(`translateY(`percent(-50.))),
+ before([
+ top(`percent(50.)),
+ transform(`translateY(`percent(-50.))),
+ left(`px(-10)),
+ borderRightColor(Colors.gray7),
+ ]),
+ ]),
+ ])
+ | Top =>
+ style([
+ Media.mobile([
+ bottom(`percent(100.)),
+ left(`percent(50.)),
+ transform(`translateX(`percent(-50.))),
+ before([
+ transform(`translateX(`percent(-50.))),
+ left(`percent(50.)),
+ bottom(`px(-10)),
+ borderTopColor(Colors.gray7),
+ ]),
+ ]),
+ ])
+ | Bottom =>
+ style([
+ Media.mobile([
+ top(`percent(100.)),
+ left(`percent(50.)),
+ transform(`translateX(`percent(-50.))),
+ before([
+ transform(`translateX(`percent(-50.))),
+ left(`percent(50.)),
+ top(`px(-10)),
+ borderBottomColor(Colors.gray7),
+ ]),
+ ]),
+ ])
+ | BottomLeft =>
+ style([
+ Media.mobile([
+ top(`percent(100.)),
+ left(`percent(50.)),
+ transform(`translateX(`percent(-30.))),
+ before([
+ transform(`translateX(`percent(-50.))),
+ left(`percent(30.)),
+ top(`px(-10)),
+ borderBottomColor(Colors.gray7),
+ ]),
+ ]),
+ ])
+ | BottomRight =>
+ style([
+ Media.mobile([
+ top(`percent(100.)),
+ left(`percent(50.)),
+ transform(`translateX(`percent(-70.))),
+ before([
+ transform(`translateX(`percent(-50.))),
+ left(`percent(70.)),
+ top(`px(-10)),
+ borderBottomColor(Colors.gray7),
+ ]),
+ ]),
]);
};
[@react.component]
-let make = (~width=150, ~tooltipText="", ~tooltipPlacement=Bottom, ~children) => {
+let make =
+ (~width=150, ~tooltipText="", ~tooltipPlacement=Bottom, ~tooltipPlacementSm=Bottom, ~children) => {
-
+
{tooltipText |> React.string}
children