react-native-boxes 1.3.20 → 1.3.23
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 +4 -1
- package/src/Bar.tsx +40 -2
- package/src/utils.ts +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "react-native-boxes",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.23",
|
|
4
4
|
"description": "A react native library for rapid development of UI using boxes",
|
|
5
5
|
"main": "src/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,5 +32,8 @@
|
|
|
32
32
|
"react-native": "^0.73.6",
|
|
33
33
|
"react-native-safe-area-context": "^4.9.0",
|
|
34
34
|
"typescript": "^5.4.3"
|
|
35
|
+
},
|
|
36
|
+
"dependencies": {
|
|
37
|
+
"@react-native-async-storage/async-storage": "^1.23.1"
|
|
35
38
|
}
|
|
36
39
|
}
|
package/src/Bar.tsx
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { useContext } from "react";
|
|
2
|
-
import { StatusBar, TextStyle, ViewProps } from "react-native";
|
|
2
|
+
import { StatusBar, TextStyle, View, ViewProps } from "react-native";
|
|
3
3
|
import { ThemeContext } from "./ThemeContext";
|
|
4
4
|
import * as React from 'react'
|
|
5
5
|
import { Center, HBox } from "./Box";
|
|
6
|
-
import { TextView } from "./Text";
|
|
6
|
+
import { Caption, TextView } from "./Text";
|
|
7
7
|
import { Icon, getIcon } from "./Image";
|
|
8
8
|
import { useSafeAreaInsets } from "react-native-safe-area-context";
|
|
9
9
|
import { PressableView } from "./Button";
|
|
@@ -213,4 +213,42 @@ export function BottomNavBar(props: ViewProps &
|
|
|
213
213
|
</HBox>
|
|
214
214
|
)
|
|
215
215
|
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
|
|
220
|
+
export type DividerProps = ViewProps & {
|
|
221
|
+
text?: string
|
|
222
|
+
}
|
|
223
|
+
export function DividerView(props: DividerProps) {
|
|
224
|
+
|
|
225
|
+
const theme = useContext(ThemeContext)
|
|
226
|
+
return (
|
|
227
|
+
<Center style={{
|
|
228
|
+
marginTop: theme.dimens.space.md,
|
|
229
|
+
marginBottom: theme.dimens.space.md,
|
|
230
|
+
flexDirection: "row",
|
|
231
|
+
width: '100%',
|
|
232
|
+
justifyContent: 'space-between'
|
|
233
|
+
}}
|
|
234
|
+
{...props}
|
|
235
|
+
>
|
|
236
|
+
<View style={{
|
|
237
|
+
backgroundColor: theme.colors.caption,
|
|
238
|
+
width: props?.text ? '40%' : '50%',
|
|
239
|
+
height: 0.1
|
|
240
|
+
}} />
|
|
241
|
+
{
|
|
242
|
+
props?.text &&
|
|
243
|
+
<Caption>
|
|
244
|
+
{props.text}
|
|
245
|
+
</Caption>
|
|
246
|
+
}
|
|
247
|
+
<View style={{
|
|
248
|
+
backgroundColor: theme.colors.caption,
|
|
249
|
+
width: props?.text ? '40%' : '50%',
|
|
250
|
+
height: 0.1
|
|
251
|
+
}} />
|
|
252
|
+
</Center>
|
|
253
|
+
)
|
|
216
254
|
}
|
package/src/utils.ts
CHANGED
|
@@ -1,6 +1,18 @@
|
|
|
1
1
|
import { Platform } from "react-native";
|
|
2
2
|
import { Dimensions } from 'react-native';
|
|
3
|
+
import AsyncStorage from '@react-native-async-storage/async-storage';
|
|
3
4
|
|
|
5
|
+
export const Storage = {
|
|
6
|
+
async getKeyAsync(key: string) {
|
|
7
|
+
return await AsyncStorage.getItem(key);
|
|
8
|
+
},
|
|
9
|
+
|
|
10
|
+
async setKeyAsync(key: string, value: string) {
|
|
11
|
+
if (typeof value == 'object')
|
|
12
|
+
value = JSON.stringify(value)
|
|
13
|
+
return await AsyncStorage.setItem(key, value);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
4
16
|
|
|
5
17
|
export function ReactWrapper(component: any) {
|
|
6
18
|
return (props: any) => {
|