@boneframework/native-components 1.0.47 → 1.0.48
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/components/SessionProvider.tsx +5 -5
- package/contexts/auth.ts +7 -4
- package/hooks/useStyle.ts +0 -2
- package/package.json +2 -2
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import React, {useEffect, useState} from 'react';
|
|
1
|
+
import React, { useEffect, useState } from 'react';
|
|
2
2
|
|
|
3
|
+
import usersApi from "@boneframework/native-components/api/users";
|
|
3
4
|
import AuthContext from "@boneframework/native-components/contexts/auth";
|
|
4
|
-
import {useSecureStorageState} from "@boneframework/native-components/hooks/useSecureStorageState";
|
|
5
|
-
import {useStorageState} from "@boneframework/native-components/hooks/useStorageState";
|
|
6
|
-
import authStorage from "@boneframework/native-components/utilities/authStorage";
|
|
7
5
|
import useApi from "@boneframework/native-components/hooks/useApi";
|
|
8
|
-
import
|
|
6
|
+
import { useSecureStorageState } from "@boneframework/native-components/hooks/useSecureStorageState";
|
|
7
|
+
import { useStorageState } from "@boneframework/native-components/hooks/useStorageState";
|
|
8
|
+
import authStorage from "@boneframework/native-components/utilities/authStorage";
|
|
9
9
|
|
|
10
10
|
function SessionProvider(props: object) {
|
|
11
11
|
const profileApi = useApi(usersApi.getProfile);
|
package/contexts/auth.ts
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
import { createContext } from "react";
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
login: () => void
|
|
3
|
+
interface AuthContextProps {
|
|
4
|
+
login: (authToken: object) => Promise<void>;
|
|
5
5
|
logout: () => void;
|
|
6
6
|
updateUser: () => void;
|
|
7
7
|
user?: object | null;
|
|
8
8
|
isLoading: boolean;
|
|
9
|
-
}
|
|
10
|
-
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
|
|
12
|
+
const AuthContext = createContext<AuthContextProps>({
|
|
13
|
+
login: (authToken: object) => null,
|
|
11
14
|
logout: () => null,
|
|
12
15
|
updateUser: () => null,
|
|
13
16
|
user: null,
|
package/hooks/useStyle.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boneframework/native-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.48",
|
|
4
4
|
"description": "Expo React Native Components for Bone Framework",
|
|
5
5
|
"main": "src/Bone.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
32
|
"@react-native-async-storage/async-storage": "^2.0.0",
|
|
33
|
-
"@react-native-community/datetimepicker": "^8.
|
|
33
|
+
"@react-native-community/datetimepicker": "^8.5.1",
|
|
34
34
|
"@react-native-community/netinfo": "^11.4.1",
|
|
35
35
|
"apisauce": "^3.1.0",
|
|
36
36
|
"dayjs": "^1.11.13",
|