react-native-boxes 1.4.27 → 1.4.29

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": "react-native-boxes",
3
- "version": "1.4.27",
3
+ "version": "1.4.29",
4
4
  "description": "A react native library for rapid development of UI using boxes",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
package/src/Message.tsx CHANGED
@@ -3,19 +3,22 @@ import * as React from "react";
3
3
  import { useContext } from 'react'
4
4
  import { ThemeContext } from "./ThemeContext";
5
5
  import FontAwesome from '@expo/vector-icons/FontAwesome';
6
- import { Platform, Pressable, Text, ViewProps } from "react-native";
6
+ import { Platform, Pressable, Text, ViewProps, ViewStyle } from "react-native";
7
7
  import { TextView } from "./Text";
8
8
  import { isDesktop } from "./utils";
9
+ import { TransparentButton } from "./Button";
9
10
 
10
11
 
11
12
 
12
13
  export function AlertMessage(props:
13
- ViewProps & {
14
+ {
14
15
  text: string,
15
16
  type?: 'info' | 'success' | 'warning' | 'critical',
16
17
  color?: string,
17
- onDismiss?: Function
18
-
18
+ onDismiss?: () => void
19
+ action?: React.ReactNode
20
+ style?: ViewStyle
21
+ onPress?: () => void
19
22
  }) {
20
23
  const theme = useContext(ThemeContext)
21
24
  const type = props.type || 'info'
@@ -74,6 +77,7 @@ export function AlertMessage(props:
74
77
  }}>{props.text}
75
78
  </TextView>
76
79
  </HBox>
80
+ {props.action}
77
81
  {
78
82
  props.onDismiss && <Pressable
79
83
  style={{
package/src/utils.ts CHANGED
@@ -96,6 +96,17 @@ export function isWeb() {
96
96
  return Platform.OS == 'web'
97
97
  }
98
98
 
99
+ export function isNative() {
100
+ return Platform.OS !== 'web'
101
+ }
102
+
103
+ export function isAndroid() {
104
+ return Platform.OS == 'android'
105
+ }
106
+
107
+ export function isIOS() {
108
+ return Platform.OS == 'ios'
109
+ }
99
110
 
100
111
  export function isDesktop() {
101
112
  const windowWidth = Dimensions.get('window').width;