react-native-boxes 1.4.26 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "react-native-boxes",
3
- "version": "1.4.26",
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/Input.tsx CHANGED
@@ -217,6 +217,7 @@ export function CompositeTextInputView(props: CompositeTextInputViewProps) {
217
217
  }
218
218
  }}
219
219
  style={[{
220
+ paddingStart: props.readOnly ? theme.dimens.space.xs : undefined,
220
221
  color: theme.colors.text,
221
222
  fontSize: theme.dimens.font.md,
222
223
  fontFamily: theme.fonts.Regular,
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/Modal.tsx CHANGED
@@ -7,7 +7,7 @@ import { ThemeContext } from './ThemeContext';
7
7
  import { Center, HBox, VBox, VPage } from './Box';
8
8
  import { Subtitle, TextView, Title } from './Text';
9
9
  import { ButtonView, ButtonViewProps, LoadingButton, PressableView, TertiaryButtonView } from './Button';
10
- import { CompositeTextInputView } from './Input';
10
+ import { CompositeTextInputView, CompositeTextInputViewProps } from './Input';
11
11
  import * as WebBrowser from 'expo-web-browser';
12
12
  import { TransparentCenterToolbar } from './Bar';
13
13
  import { GestureDetector, Gesture, Directions } from 'react-native-gesture-handler';
@@ -380,7 +380,7 @@ export type DropDownViewProps = {
380
380
  onRenderOption?: (opt: DropDownViewOption) => any,
381
381
  forceDialogSelectOnWeb?: Boolean
382
382
  swipeToCloseDisabled?: boolean
383
- } & ViewProps
383
+ } & CompositeTextInputViewProps
384
384
 
385
385
  /**
386
386
  * set swipeToCloseDisabled = true if you face issues with scrolling
package/src/utils.ts CHANGED
@@ -3,10 +3,21 @@ import { Dimensions } from 'react-native';
3
3
  import AsyncStorage from '@react-native-async-storage/async-storage';
4
4
 
5
5
 
6
+ function extractPathFromUrl(url: string): string {
7
+ const pathStartIndex = url.indexOf('/', url.indexOf('//') + 2);
8
+ if (pathStartIndex === -1) {
9
+ return '';
10
+ }
11
+ return url.substring(pathStartIndex + 1); // +1 to remove leading '/'
12
+ }
13
+
6
14
  export function getNavParamsFromDeeplink(url: string) {
7
15
  if (url?.startsWith("/")) {
8
16
  url = url.substring(1)
9
17
  }
18
+ if (url?.startsWith("http")) {
19
+ url = extractPathFromUrl(url)
20
+ }
10
21
  let parts = url.split("/");
11
22
 
12
23
  let root, rootParams: any = {};