react-native-boxes 1.4.27 → 1.4.28

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/src/Message.tsx +8 -4
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.28",
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={{