@onehat/ui 0.2.56 → 0.2.57

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": "@onehat/ui",
3
- "version": "0.2.56",
3
+ "version": "0.2.57",
4
4
  "description": "Base UI for OneHat apps",
5
5
  "main": "src/index.js",
6
6
  "type": "module",
@@ -1,4 +1,6 @@
1
- import {
1
+ import {
2
+ Button,
3
+ Modal,
2
4
  Row,
3
5
  Text,
4
6
  } from 'native-base';
@@ -9,10 +11,20 @@ export default function WaitMessage(props) {
9
11
  textMessage = 'Please wait...',
10
12
  } = props;
11
13
 
12
- return <Row position="absolute" width="100%" top="40" left="0" _backdrop={{ bg: "#000" }} justifyContent="center" alignItems="center" pb={20} {...props}>
13
- <Row bg="#fff" p={3} width="50%" justifyContent="center" alignItems="center" borderColor="#000" borderRadius={5}>
14
- <Loading minHeight="auto" h={5} w={5} mr={2} />
15
- <Text color="#000">{textMessage}</Text>
16
- </Row>
17
- </Row>;
14
+ return <Modal {...props} _backdrop={{ bg: "#000" }}>
15
+ <Modal.Content>
16
+ <Modal.Body
17
+ borderTopWidth={0}
18
+ bg="#fff"
19
+ p={3}
20
+ justifyContent="center"
21
+ alignItems="center"
22
+ borderRadius={5}
23
+ flexDirection="row"
24
+ >
25
+ <Loading minHeight="auto" h={5} w={5} mr={2} />
26
+ <Text color="#000">{textMessage}</Text>
27
+ </Modal.Body>
28
+ </Modal.Content>
29
+ </Modal>;
18
30
  }
@@ -1,7 +1,7 @@
1
- import AppGlobals from '../../AppGlobals.js';
1
+ import UiGlobals from '../UiGlobals.js';
2
2
 
3
3
  export default function(clearAll = false) {
4
- const reduxState = AppGlobals.redux.getState();
4
+ const reduxState = UiGlobals.redux.getState();
5
5
  if (!reduxState.App.user || (!reduxState.App.user.token && !reduxState.App.user.users__token)) {
6
6
  return {};
7
7
  }
package/src/UiGlobals.js CHANGED
@@ -1,8 +1,13 @@
1
1
  import { CURRENT_MODE } from './Constants/UiModes.js';
2
+ import _ from 'lodash';
2
3
 
3
4
 
4
5
  const Globals = {
5
6
  mode: CURRENT_MODE,
6
7
  };
7
8
 
8
- export default Globals;
9
+ export default Globals;
10
+
11
+ export function setGlobals(globals) {
12
+ _.merge(Globals, globals);
13
+ }