@boneframework/native-components 1.0.47 → 1.0.49

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.
@@ -24,4 +24,4 @@ const styles = StyleSheet.create({
24
24
  }
25
25
  })
26
26
 
27
- export default Screen;
27
+ export default Screen;
@@ -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 usersApi from "@boneframework/native-components/api/users";
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
- const AuthContext = createContext<{
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
- login: () => null,
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,
@@ -3,7 +3,7 @@ import { createContext } from "react";
3
3
 
4
4
  const ColorContext = createContext<ThemeColors>(defaultTheme);
5
5
 
6
- type ColorsProviderProps = {
6
+ export type ColorsProviderProps = {
7
7
  children: React.ReactNode;
8
8
  value: ThemeColors;
9
9
  };
@@ -1,9 +1,11 @@
1
- import { useContext } from "react";
2
1
 
3
- import ColorContext from "../contexts/colors";
2
+ // import { useContext } from "react";
3
+ import colors from "../../../../config/colors";
4
+ // import ColorContext from "@boneframework/native-components/contexts/colors";
4
5
 
5
6
  const useColors = () => {
6
- return useContext(ColorContext);
7
+ // return useContext(ColorContext);
8
+ return colors
7
9
  }
8
10
 
9
11
  export default useColors;
package/hooks/useStyle.ts CHANGED
@@ -1,15 +1,11 @@
1
- import { useState } from "react";
1
+ import useColors from "@boneframework/native-components/hooks/useColors";
2
2
  import { Platform, useColorScheme } from "react-native";
3
3
 
4
- import useColors from "./useColors";
5
4
 
6
5
  const useStyle = () => {
7
6
  const colorScheme = useColorScheme();
8
- const [mode, setMode] = useState();
9
7
  const dark = colorScheme == 'dark';
10
8
  const colors = useColors();
11
- console.log(colors);
12
- console.log('xxxxxxx');
13
9
 
14
10
  const style = {
15
11
  dark: dark,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@boneframework/native-components",
3
- "version": "1.0.47",
3
+ "version": "1.0.49",
4
4
  "description": "Expo React Native Components for Bone Framework",
5
5
  "main": "src/Bone.ts",
6
6
  "scripts": {
@@ -30,20 +30,20 @@
30
30
  },
31
31
  "dependencies": {
32
32
  "@react-native-async-storage/async-storage": "^2.0.0",
33
- "@react-native-community/datetimepicker": "^8.2.0",
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",
37
37
  "expo-auth-session": "^6.0.0",
38
- "expo-camera": "^16.0.5",
39
- "expo-constants": "^17.0.3",
38
+ "expo-camera": "^17.0.10",
39
+ "expo-constants": "^19.1.0",
40
40
  "expo-device": "^7.0.1",
41
- "expo-image": "^2.0.0",
42
- "expo-image-picker": "^16.0.2",
43
- "expo-linear-gradient": "~14.0.1",
44
- "expo-location": "~18.0.1",
45
- "expo-notifications": "^0.29.8",
46
- "expo-router": "^4.0.5",
41
+ "expo-image": "^3.0.11",
42
+ "expo-image-picker": "^17.0.9",
43
+ "expo-linear-gradient": "^15.0.8",
44
+ "expo-location": "^19.0.8",
45
+ "expo-notifications": "^0.32.14",
46
+ "expo-router": "^6.0.17",
47
47
  "expo-secure-store": "^14.0.0",
48
48
  "formik": "^2.4.6",
49
49
  "jwt-decode": "^4.0.0",