@rpcbase/client 0.182.0 → 0.183.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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rpcbase/client",
3
- "version": "0.182.0",
3
+ "version": "0.183.0",
4
4
  "scripts": {
5
5
  "test": "../../node_modules/.bin/wireit"
6
6
  },
@@ -1,6 +1,6 @@
1
1
  import {ErrorBoundary as ReactErrorBoundary} from "react-error-boundary"
2
2
 
3
- import {RedBoxError} from "@rpcbase/redbox-react"
3
+ import {RedBoxError} from "../RedboxError"
4
4
 
5
5
  // TODO: in production Redbox should just say there is an error but not display a stacktrace or more info
6
6
  export const ErrorBoundary = ({children, ...props}) => {
@@ -1,3 +1,3 @@
1
1
  import {RedBoxError} from "@rpcbase/redbox-react"
2
2
 
3
- export default RedBoxError
3
+ export {RedBoxError}
@@ -0,0 +1,12 @@
1
+ /* @flow */
2
+ import {forwardRef} from "react"
3
+ import {View as RNView} from "react-native"
4
+
5
+
6
+ export const View = forwardRef(({children, ...props}, ref) => {
7
+ return (
8
+ <RNView ref={ref} {...props}>
9
+ {children}
10
+ </RNView>
11
+ )
12
+ })
@@ -0,0 +1,42 @@
1
+ /* @flow */
2
+ import {forwardRef} from "react"
3
+ import Tooltip from "react-bootstrap/Tooltip"
4
+ import OverlayTrigger from "react-bootstrap/OverlayTrigger"
5
+
6
+
7
+ export const View = forwardRef(
8
+ ({children, tooltip, tooltipProps = {style: {}}, className = "", ...props}, ref) => {
9
+ const comp = (
10
+ <div ref={ref} className={cx("d-flex", className)} {...props}>
11
+ {children}
12
+ </div>
13
+ )
14
+
15
+ if (tooltip) {
16
+ const renderTooltip = ({style, ...overlayTooltipProps}) => {
17
+ return (
18
+ <Tooltip
19
+ {...overlayTooltipProps}
20
+ {...tooltipProps}
21
+ placement="left-start"
22
+ style={{...style, ...tooltipProps.style}}
23
+ >
24
+ {tooltip}
25
+ </Tooltip>
26
+ )
27
+ }
28
+ return (
29
+ <OverlayTrigger
30
+ placement="top"
31
+ transition={false}
32
+ delay={{show: 0, hide: 100}}
33
+ overlay={renderTooltip}
34
+ >
35
+ {comp}
36
+ </OverlayTrigger>
37
+ )
38
+ }
39
+
40
+ return comp
41
+ },
42
+ )