@colisweb/rescript-toolkit 5.6.9 → 5.7.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -5,6 +5,7 @@ let make = (
|
|
|
5
5
|
~className="",
|
|
6
6
|
~textClassName="",
|
|
7
7
|
~copyButtonSize=9,
|
|
8
|
+
~onReferenceClick=?,
|
|
8
9
|
) => {
|
|
9
10
|
let refClipboard = Toolkit__Hooks.useClipboard(reference, ~onCopyNotificationMessage?)
|
|
10
11
|
|
|
@@ -13,7 +14,9 @@ let make = (
|
|
|
13
14
|
"flex flex-row items-center bg-info-50 text-info-700 min-w-0 w-full",
|
|
14
15
|
className,
|
|
15
16
|
])}>
|
|
16
|
-
<p
|
|
17
|
+
<p
|
|
18
|
+
onClick={_ => onReferenceClick->Option.forEach(fn => fn())}
|
|
19
|
+
className={cx(["font-mono w-full text-sm pl-2 truncate", textClassName])}>
|
|
17
20
|
{reference->React.string}
|
|
18
21
|
</p>
|
|
19
22
|
<Toolkit__Ui_IconButton
|
|
@@ -56,7 +56,7 @@ let make = (
|
|
|
56
56
|
) => {
|
|
57
57
|
let {isSm} = Toolkit__Hooks.useMediaQuery()
|
|
58
58
|
|
|
59
|
-
let periodLength =
|
|
59
|
+
let periodLength = periodLength->Option.getWithDefault(isSm ? 7 : 3)
|
|
60
60
|
|
|
61
61
|
let ({period, selectedDay}, dispatch) = ReactUpdate.useReducerWithMapState(
|
|
62
62
|
(state, action) =>
|
|
@@ -203,14 +203,16 @@ let make = (
|
|
|
203
203
|
<FormattedDate value=day day=#"2-digit" />
|
|
204
204
|
</span>
|
|
205
205
|
</p>
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
206
|
+
{counters
|
|
207
|
+
->Option.flatMap(counters =>
|
|
208
|
+
counters->Js.Dict.get(day->DateFns.formatWithPattern("yyyy-MM-dd"))
|
|
209
|
+
)
|
|
210
|
+
->Option.mapWithDefault(React.null, value => {
|
|
211
|
+
<p
|
|
212
|
+
className="text-xs text-info-500 bg-info-50 text-center mt-1 font-semibold rounded-sm">
|
|
213
|
+
{value->React.int}
|
|
214
|
+
</p>
|
|
215
|
+
})}
|
|
214
216
|
</div>
|
|
215
217
|
</React.Fragment>
|
|
216
218
|
})
|