react-native-boxes 1.4.1 → 1.4.3

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.1",
3
+ "version": "1.4.3",
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/List.tsx CHANGED
@@ -66,13 +66,15 @@ export function SimpleDatatlistViewItem(props: SimpleDatatableViewItemProps & Vi
66
66
  style={[{
67
67
  margin: 0,
68
68
  marginBottom: theme.dimens.space.sm,
69
- padding: theme.dimens.space.md,
69
+ padding: theme.dimens.space.sm,
70
70
  alignItems: 'center',
71
71
  flexDirection: 'row',
72
72
  justifyContent: 'space-evenly'
73
73
  }, props.style]}>
74
74
 
75
75
  <Box style={{
76
+ margin: 0,
77
+ padding: 0,
76
78
  justifyContent: 'center',
77
79
  alignContent: 'center',
78
80
  alignItems: 'center',
@@ -86,6 +88,8 @@ export function SimpleDatatlistViewItem(props: SimpleDatatableViewItemProps & Vi
86
88
  }} />}
87
89
  </Box>
88
90
  <VBox style={{
91
+ margin: 0,
92
+ padding: 0,
89
93
  //@ts-ignore
90
94
  paddingStart: flexRatio.left > 1 ? theme.dimens.space.md : 0,
91
95
  width: `${percentages.middle}%`,
@@ -101,9 +105,13 @@ export function SimpleDatatlistViewItem(props: SimpleDatatableViewItemProps & Vi
101
105
  }}>{props.title}</Subtitle>)}
102
106
  {props.subtitle && (<TextView style={{
103
107
  marginTop: 0,
108
+ padding: 0,
104
109
  paddingTop: theme.dimens.space.sm,
105
110
  }}>{props.subtitle}</TextView>)}
106
- {props.body && (<Caption >{props.body}</Caption>)}
111
+ {props.body && (<Caption style={{
112
+ padding: 0,
113
+ margin: 0
114
+ }}>{props.body}</Caption>)}
107
115
  </VBox>
108
116
  <Box style={{
109
117
  alignItems: 'flex-end',
package/src/Message.tsx CHANGED
@@ -12,6 +12,7 @@ export function AlertMessage(props:
12
12
  ViewProps & {
13
13
  text: string,
14
14
  type?: 'info' | 'success' | 'warning' | 'critical',
15
+ color?: string,
15
16
  onDismiss?: Function
16
17
 
17
18
  }) {
@@ -63,11 +64,11 @@ export function AlertMessage(props:
63
64
  }}
64
65
  name={icon}
65
66
  size={theme.dimens.icon.md}
66
- color={theme.colors.invert.text} />
67
+ color={props.color || theme.colors.invert.text} />
67
68
  <TextView style={{
68
69
  flexShrink: 1,
69
70
  padding: 0,
70
- color: theme.colors.invert.text,
71
+ color: props.color || theme.colors.invert.text,
71
72
  }}>{props.text}
72
73
  </TextView>
73
74
  </HBox>
package/src/Modal.tsx CHANGED
@@ -481,10 +481,14 @@ export function ConfirmationDialog(props: ConfirmationDialogProps) {
481
481
  props.onDismiss && props.onDismiss()
482
482
  props.onConfirm && props.onConfirm()
483
483
  }} />
484
- <TertiaryButtonView text={cancelText as string} onPress={() => {
485
- props.onDismiss && props.onDismiss()
486
- props.onCancel && props.onCancel()
487
- }} />
484
+ <TertiaryButtonView
485
+ style={{
486
+ marginTop: 0
487
+ }}
488
+ text={cancelText as string} onPress={() => {
489
+ props.onDismiss && props.onDismiss()
490
+ props.onCancel && props.onCancel()
491
+ }} />
488
492
  </VBox>
489
493
 
490
494
  </BottomSheet>
package/src/Text.tsx CHANGED
@@ -4,14 +4,24 @@ import { ThemeContext } from "./ThemeContext";
4
4
 
5
5
  export type TextViewProps = TextProps & {
6
6
  skipI18n?: boolean
7
+ value?: string
8
+ text?: string
7
9
  }
8
10
  export function TextView(props: TextViewProps) {
9
11
  const theme = useContext(ThemeContext)
10
12
  let children = props.children
13
+ let value = props.value
14
+ let text = props.text
11
15
  if (theme.i18n && !props.skipI18n) {
12
16
  if (children && typeof children == 'string') {
13
17
  children = theme.i18n.t(children)
14
18
  }
19
+ if (value) {
20
+ value = theme.i18n.t(value)
21
+ }
22
+ if (text) {
23
+ text = theme.i18n.t(text)
24
+ }
15
25
  }
16
26
  return (
17
27
  <Text {...props}
@@ -20,7 +30,7 @@ export function TextView(props: TextViewProps) {
20
30
  color: theme.colors.text,
21
31
  padding: theme.dimens.space.sm
22
32
  }, theme.styles.text, props.style]} >
23
- {children}
33
+ {children || text || value}
24
34
  </Text>
25
35
  )
26
36
  }