@boneframework/native-components 1.0.55 → 1.0.57
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/api/client.ts +7 -6
- package/api/notifications.ts +12 -0
- package/api/{ping.js → ping.ts} +9 -9
- package/api/users.ts +35 -0
- package/assets/animations/done.json +1 -0
- package/assets/animations/email.json +1 -0
- package/assets/animations/loader.json +1 -0
- package/assets/background.png +0 -0
- package/assets/logo.png +0 -0
- package/components/ActivityIndicator.tsx +2 -2
- package/components/Animation.tsx +12 -2
- package/components/ApiInterceptor.tsx +4 -3
- package/components/BoneNativeProvider.tsx +31 -0
- package/components/Button.tsx +26 -21
- package/components/Image.tsx +8 -2
- package/components/ImageInput.tsx +2 -1
- package/components/ListItemDeleteAction.tsx +12 -10
- package/components/ListItemFlipswitch.tsx +1 -2
- package/components/ListItemSwipable.tsx +2 -1
- package/components/OfflineNotice.tsx +17 -15
- package/components/Text.tsx +4 -4
- package/components/forms/FormImagePicker.tsx +36 -0
- package/contexts/api.ts +12 -0
- package/contexts/cache.ts +14 -0
- package/contexts/colors.ts +3 -3
- package/contexts/settings.ts +33 -0
- package/contexts/theme.ts +21 -15
- package/hooks/useColors.ts +4 -6
- package/hooks/useNotifications.web.ts +14 -0
- package/hooks/useSettings.ts +9 -0
- package/package.json +4 -2
- package/screens/ActivateUserScreen.tsx +3 -1
- package/screens/CheckEmailScreen.tsx +36 -32
- package/screens/EditProfileScreen.tsx +2 -3
- package/screens/MapScreen.web.tsx +22 -0
- package/screens/RegisterScreen.tsx +8 -4
- package/screens/ResendActivationlScreen.tsx +36 -31
- package/screens/SetPasswordScreen.tsx +6 -2
- package/screens/UploadScreen.tsx +3 -1
- package/screens/WelcomeScreen.tsx +13 -4
- package/api/notifications.js +0 -11
- package/api/users.js +0 -35
- package/components/ColorProvider.tsx +0 -10
- package/components/forms/FormImagePicker.js +0 -30
- /package/components/forms/{ErrorMessage.js → ErrorMessage.tsx} +0 -0
- /package/components/forms/{Form.js → Form.tsx} +0 -0
- /package/components/forms/{FormDateTimePicker.js → FormDateTimePicker.tsx} +0 -0
- /package/components/forms/{FormField.js → FormField.tsx} +0 -0
- /package/components/forms/{FormPicker.js → FormPicker.tsx} +0 -0
- /package/components/forms/{SubmitButton.js → SubmitButton.tsx} +0 -0
- /package/components/forms/{index.js → index.ts} +0 -0
- /package/hooks/{useNotifications.ts → useNotifications.native.ts} +0 -0
- /package/screens/{MapScreen.tsx → MapScreen.native.tsx} +0 -0
package/contexts/api.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
|
|
3
|
+
interface CacheContextProps {
|
|
4
|
+
blacklist: string[];
|
|
5
|
+
cacheExpiryMinutes: number;
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
const CacheContext = createContext<CacheContextProps>({
|
|
10
|
+
blacklist: [],
|
|
11
|
+
cacheExpiryMinutes: 0
|
|
12
|
+
});
|
|
13
|
+
|
|
14
|
+
export default CacheContext;
|
package/contexts/colors.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { ThemeColors, defaultTheme } from "
|
|
1
|
+
import { ThemeColors, defaultTheme } from "../contexts/theme";
|
|
2
2
|
import { createContext } from "react";
|
|
3
3
|
|
|
4
|
-
const ColorContext = createContext<ThemeColors>(defaultTheme);
|
|
4
|
+
const ColorContext = createContext<ThemeColors>(defaultTheme.colors);
|
|
5
5
|
|
|
6
6
|
export type ColorsProviderProps = {
|
|
7
7
|
children: React.ReactNode;
|
|
8
8
|
value: ThemeColors;
|
|
9
9
|
};
|
|
10
10
|
|
|
11
|
-
export default ColorContext;
|
|
11
|
+
export default ColorContext;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createContext } from "react";
|
|
2
|
+
import Constants from "expo-constants";
|
|
3
|
+
import { bool } from "yup";
|
|
4
|
+
|
|
5
|
+
const apiUrl = process.env.EXPO_PUBLIC_API_URL;
|
|
6
|
+
const clientId = process.env.EXPO_PUBLIC_API_CLIENT_ID;
|
|
7
|
+
|
|
8
|
+
interface SettingsContextProps {
|
|
9
|
+
apiUrl: string,
|
|
10
|
+
authCallbackURL: 'oauth2/callback',
|
|
11
|
+
clientId: string,
|
|
12
|
+
discovery: {
|
|
13
|
+
authEndpoint: string,
|
|
14
|
+
tokenEndpoint: string,
|
|
15
|
+
},
|
|
16
|
+
scheme: 'bone',
|
|
17
|
+
xDebugHeader: boolean,
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
|
|
21
|
+
const SettingsContext = createContext<SettingsContextProps>({
|
|
22
|
+
apiUrl: apiUrl,
|
|
23
|
+
authCallbackURL: 'oauth2/callback',
|
|
24
|
+
clientId: clientId,
|
|
25
|
+
discovery: {
|
|
26
|
+
authEndpoint: apiUrl + '/en_GB/oauth2/authorize',
|
|
27
|
+
tokenEndpoint: apiUrl + '/en_GB/oauth2/token',
|
|
28
|
+
},
|
|
29
|
+
scheme: 'bone',
|
|
30
|
+
xDebugHeader: false,
|
|
31
|
+
});
|
|
32
|
+
|
|
33
|
+
export default SettingsContext;
|
package/contexts/theme.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { createContext
|
|
1
|
+
import {Context, createContext} from 'react';
|
|
2
2
|
|
|
3
3
|
type ThemeColors = {
|
|
4
4
|
primary: string;
|
|
@@ -14,22 +14,28 @@ type ThemeColors = {
|
|
|
14
14
|
bgGradient: string[];
|
|
15
15
|
};
|
|
16
16
|
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
secondary: '#4ecdc4',
|
|
20
|
-
black: '#000',
|
|
21
|
-
white: '#fff',
|
|
22
|
-
light: '#f0f4f4',
|
|
23
|
-
whitish: '#ddd',
|
|
24
|
-
medium: '#999',
|
|
25
|
-
darkish: '#333',
|
|
26
|
-
dark: '#222',
|
|
27
|
-
danger: '#ff5200',
|
|
28
|
-
bgGradient: ['#001C50', '#003698']
|
|
17
|
+
type ThemeColorsProp = {
|
|
18
|
+
colors: ThemeColors
|
|
29
19
|
};
|
|
30
20
|
|
|
31
|
-
const
|
|
21
|
+
const defaultTheme: ThemeColorsProp = {
|
|
22
|
+
colors: {
|
|
23
|
+
primary: '#fc5c65',
|
|
24
|
+
secondary: '#4ecdc4',
|
|
25
|
+
black: '#000',
|
|
26
|
+
white: '#fff',
|
|
27
|
+
light: '#f0f4f4',
|
|
28
|
+
whitish: '#ddd',
|
|
29
|
+
medium: '#999',
|
|
30
|
+
darkish: '#333',
|
|
31
|
+
dark: '#222',
|
|
32
|
+
danger: '#ff5200',
|
|
33
|
+
bgGradient: ['#001C50', '#003698']
|
|
34
|
+
}
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
const ThemeContext: Context<ThemeColors> = createContext<ThemeColors>(defaultTheme);
|
|
32
38
|
|
|
33
39
|
export default ThemeContext;
|
|
34
|
-
export { defaultTheme, ThemeColors };
|
|
40
|
+
export { defaultTheme, ThemeColors, ThemeColorsProp };
|
|
35
41
|
|
package/hooks/useColors.ts
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
// import ColorContext from "@boneframework/native-components/contexts/colors";
|
|
2
|
+
import { useContext } from "react";
|
|
3
|
+
import ColorContext from "../contexts/colors";
|
|
5
4
|
|
|
6
5
|
const useColors = () => {
|
|
7
|
-
|
|
8
|
-
return colors
|
|
6
|
+
return useContext(ColorContext);
|
|
9
7
|
}
|
|
10
8
|
|
|
11
|
-
export default useColors;
|
|
9
|
+
export default useColors;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import * as Device from "expo-device";
|
|
2
|
+
import * as Notifications from "expo-notifications";
|
|
3
|
+
import {useEffect} from "react";
|
|
4
|
+
import {Platform} from "react-native";
|
|
5
|
+
import Constants from "expo-constants";
|
|
6
|
+
|
|
7
|
+
import expoPushTokensApi from "../api/notifications";
|
|
8
|
+
import {useStorageState} from "./useStorageState";
|
|
9
|
+
|
|
10
|
+
const useNotifications = (notificationReceivedListener = notification => {}) => {
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export default useNotifications;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@boneframework/native-components",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.57",
|
|
4
4
|
"description": "Expo React Native Components for Bone Framework",
|
|
5
5
|
"main": "src/Bone.ts",
|
|
6
6
|
"scripts": {
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"access": "public"
|
|
30
30
|
},
|
|
31
31
|
"dependencies": {
|
|
32
|
+
"@lottiefiles/dotlottie-react": "^0.17.12",
|
|
33
|
+
"@lottiefiles/dotlottie-react-native": "^0.7.1",
|
|
32
34
|
"@react-native-async-storage/async-storage": "^2.2.0",
|
|
33
35
|
"@react-native-community/datetimepicker": "^8.5.1",
|
|
34
36
|
"@react-native-community/netinfo": "^11.4.1",
|
|
@@ -48,7 +50,7 @@
|
|
|
48
50
|
"formik": "^2.4.9",
|
|
49
51
|
"jwt-decode": "^4.0.0",
|
|
50
52
|
"lottie-react-native": "^7.3.4",
|
|
51
|
-
"react": "
|
|
53
|
+
"react": "19.1.0",
|
|
52
54
|
"react-native-gesture-handler": "^2.29.1",
|
|
53
55
|
"react-native-maps": "^1.26.19",
|
|
54
56
|
"react-native-progress": "^5.0.1",
|
|
@@ -11,7 +11,7 @@ import useApi from "../hooks/useApi";
|
|
|
11
11
|
import useAuth from "../hooks/useAuth";
|
|
12
12
|
|
|
13
13
|
import userApi from "../api/users";
|
|
14
|
-
import
|
|
14
|
+
import useColors from "@boneframework/native-components/hooks/useColors";
|
|
15
15
|
|
|
16
16
|
function ActivateUserScreen({settings, loginRedirect, resendActivationEmailRedirect, backgroundSource = null}) {
|
|
17
17
|
const STATUS_BEGIN = 'start_validating';
|
|
@@ -32,6 +32,8 @@ function ActivateUserScreen({settings, loginRedirect, resendActivationEmailRedir
|
|
|
32
32
|
const email = params.email;
|
|
33
33
|
const token = params.token;
|
|
34
34
|
|
|
35
|
+
const colors = useColors();
|
|
36
|
+
|
|
35
37
|
const validateEmailToken = async () => {
|
|
36
38
|
setStatus(STATUS_VALIDATE);
|
|
37
39
|
const result = await validateEmailTokenApi.request(email, token);
|
|
@@ -4,18 +4,51 @@ import React from "react";
|
|
|
4
4
|
import Animation from "../components/Animation";
|
|
5
5
|
import Background from "../components/Background";
|
|
6
6
|
import Text from '../components/Text';
|
|
7
|
+
import useColors from "@boneframework/native-components/hooks/useColors";
|
|
7
8
|
|
|
8
|
-
import colors from "../../../../config/colors";
|
|
9
9
|
|
|
10
10
|
function CheckEmailScreen({backgroundSource = null}) {
|
|
11
11
|
|
|
12
|
+
const colors = useColors();
|
|
13
|
+
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
container: {
|
|
16
|
+
flex: 1,
|
|
17
|
+
paddingHorizontal: 20
|
|
18
|
+
},
|
|
19
|
+
animationContainer: {
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
flex: 1,
|
|
23
|
+
paddingHorizontal: 10,
|
|
24
|
+
marginTop: -50
|
|
25
|
+
},
|
|
26
|
+
animation: {
|
|
27
|
+
width: 150,
|
|
28
|
+
height: 150,
|
|
29
|
+
},
|
|
30
|
+
activate: {
|
|
31
|
+
marginTop: 20,
|
|
32
|
+
textTransform: 'uppercase',
|
|
33
|
+
fontSize: 24,
|
|
34
|
+
fontWeight: 'bold',
|
|
35
|
+
marginBottom: 20,
|
|
36
|
+
color: colors.white,
|
|
37
|
+
textAlign: 'center'
|
|
38
|
+
},
|
|
39
|
+
info: {
|
|
40
|
+
color: colors.white,
|
|
41
|
+
textAlign: 'center'
|
|
42
|
+
},
|
|
43
|
+
})
|
|
44
|
+
|
|
12
45
|
return (
|
|
13
46
|
<Background blurRadius={10} style={styles.container} imageSource={backgroundSource} gradientColors={colors.bgGradient} >
|
|
14
47
|
<View style={styles.animationContainer}>
|
|
15
48
|
<Animation
|
|
16
49
|
autoPlay={true}
|
|
17
50
|
loop={true}
|
|
18
|
-
source={require('
|
|
51
|
+
source={require('../assets/animations/email.json')}
|
|
19
52
|
style={styles.animation}
|
|
20
53
|
speed={1}
|
|
21
54
|
/>
|
|
@@ -26,35 +59,6 @@ function CheckEmailScreen({backgroundSource = null}) {
|
|
|
26
59
|
);
|
|
27
60
|
}
|
|
28
61
|
|
|
29
|
-
|
|
30
|
-
container: {
|
|
31
|
-
flex: 1,
|
|
32
|
-
paddingHorizontal: 20
|
|
33
|
-
},
|
|
34
|
-
animationContainer: {
|
|
35
|
-
alignItems: 'center',
|
|
36
|
-
justifyContent: 'center',
|
|
37
|
-
flex: 1,
|
|
38
|
-
paddingHorizontal: 10,
|
|
39
|
-
marginTop: -50
|
|
40
|
-
},
|
|
41
|
-
animation: {
|
|
42
|
-
width: 150,
|
|
43
|
-
height: 150,
|
|
44
|
-
},
|
|
45
|
-
activate: {
|
|
46
|
-
marginTop: 20,
|
|
47
|
-
textTransform: 'uppercase',
|
|
48
|
-
fontSize: 24,
|
|
49
|
-
fontWeight: 'bold',
|
|
50
|
-
marginBottom: 20,
|
|
51
|
-
color: colors.white,
|
|
52
|
-
textAlign: 'center'
|
|
53
|
-
},
|
|
54
|
-
info: {
|
|
55
|
-
color: colors.white,
|
|
56
|
-
textAlign: 'center'
|
|
57
|
-
},
|
|
58
|
-
})
|
|
62
|
+
|
|
59
63
|
|
|
60
64
|
export default CheckEmailScreen;
|
|
@@ -20,8 +20,7 @@ import useAuth from "../hooks/useAuth";
|
|
|
20
20
|
import useCamera from "../hooks/useCamera";
|
|
21
21
|
import usePhotos from "../hooks/usePhotos";
|
|
22
22
|
import useStyle from "../hooks/useStyle";
|
|
23
|
-
|
|
24
|
-
import colors from '../../../../config/colors';
|
|
23
|
+
import useColors from '@boneframework/native-components/hooks/useColors';
|
|
25
24
|
|
|
26
25
|
const validationSchema = Yup.object().shape({
|
|
27
26
|
firstname: Yup.string().required().min(2).max(60).label('First name'),
|
|
@@ -39,7 +38,7 @@ function EditProfileScreen(props) {
|
|
|
39
38
|
const [profileImage, setProfileImage] = useState(null);
|
|
40
39
|
const [profileBackground, setProfileBackground] = useState(null);
|
|
41
40
|
const style = useStyle();
|
|
42
|
-
|
|
41
|
+
const colors = useColors();
|
|
43
42
|
const { updateUser, user} = useAuth();
|
|
44
43
|
const updateProfileApi = useApi(userApi.updateProfile);
|
|
45
44
|
const userImageUploadApi = useApi(userApi.uploadUserImage);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import {StyleSheet, Text, View} from "react-native";
|
|
3
|
+
|
|
4
|
+
function MapScreen(props) {
|
|
5
|
+
return (
|
|
6
|
+
<View style={styles.container}>
|
|
7
|
+
<Text>Map Screen Web, use Pigeon Maps - @todo</Text>
|
|
8
|
+
</View>
|
|
9
|
+
);
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const styles = StyleSheet.create({
|
|
13
|
+
container: {
|
|
14
|
+
flex: 1,
|
|
15
|
+
},
|
|
16
|
+
map: {
|
|
17
|
+
width: '100%',
|
|
18
|
+
height: '100%',
|
|
19
|
+
},
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
export default MapScreen;
|
|
@@ -9,17 +9,17 @@ import useApi from "../hooks/useApi";
|
|
|
9
9
|
import usersApi from '../api/users';
|
|
10
10
|
import {ErrorMessage, FormField, Form, SubmitButton} from '../components/forms'
|
|
11
11
|
import Icon from "../components/Icon";
|
|
12
|
-
|
|
13
|
-
import colors from "../../../../config/colors";
|
|
12
|
+
import useColors from '@boneframework/native-components/hooks/useColors';
|
|
14
13
|
|
|
15
14
|
const validationSchema = Yup.object().shape({
|
|
16
15
|
email: Yup.string().required().email().label('Email'),
|
|
17
16
|
});
|
|
18
17
|
|
|
19
|
-
function RegisterScreen({postRegisterUrl, backgroundSource = null}) {
|
|
18
|
+
function RegisterScreen({postRegisterUrl, backgroundSource = null, logoSource = null}) {
|
|
20
19
|
const registerApi = useApi(usersApi.register);
|
|
21
20
|
const [error, setError] = useState();
|
|
22
21
|
const onClose = () => router.back();
|
|
22
|
+
const colors = useColors();
|
|
23
23
|
|
|
24
24
|
const handleSubmit = async userInfo => {
|
|
25
25
|
Keyboard.dismiss();
|
|
@@ -39,6 +39,10 @@ function RegisterScreen({postRegisterUrl, backgroundSource = null}) {
|
|
|
39
39
|
router.navigate(postRegisterUrl);
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
+
if (!logoSource) {
|
|
43
|
+
logoSource = require('../assets/logo.png');
|
|
44
|
+
}
|
|
45
|
+
|
|
42
46
|
return (
|
|
43
47
|
<>
|
|
44
48
|
<ActivityIndicator visible={registerApi.loading} type={'overlay'}/>
|
|
@@ -47,7 +51,7 @@ function RegisterScreen({postRegisterUrl, backgroundSource = null}) {
|
|
|
47
51
|
<TouchableOpacity style={styles.cancelButton} onPress={onClose}>
|
|
48
52
|
<Icon size={75} name={'chevron-left'} />
|
|
49
53
|
</TouchableOpacity>
|
|
50
|
-
<Image style={styles.logo} source={require(
|
|
54
|
+
<Image style={styles.logo} source={require(logoSource)} />
|
|
51
55
|
|
|
52
56
|
<Form
|
|
53
57
|
initialValues={{ email: ''}}
|
|
@@ -3,14 +3,45 @@ import {StyleSheet, View} from "react-native";
|
|
|
3
3
|
import Text from '../components/Text';
|
|
4
4
|
import Button from "../components/Button";
|
|
5
5
|
import Image from "../components/Image";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
function ResendActivationScreen({tokenError, submitCallback}) {
|
|
6
|
+
import useColors from "@boneframework/native-components/hooks/useColors";
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
function ResendActivationScreen({tokenError, submitCallback, logosource}) {
|
|
10
|
+
const colors = useColors();
|
|
11
|
+
|
|
12
|
+
const styles = StyleSheet.create({
|
|
13
|
+
container: {
|
|
14
|
+
flex: 1,
|
|
15
|
+
justifyContent: 'center',
|
|
16
|
+
},
|
|
17
|
+
logo: {
|
|
18
|
+
width: 150,
|
|
19
|
+
height: 105,
|
|
20
|
+
alignSelf: "center",
|
|
21
|
+
marginTop: 50,
|
|
22
|
+
marginBottom: 20,
|
|
23
|
+
},
|
|
24
|
+
resendText: {
|
|
25
|
+
color: colors.white,
|
|
26
|
+
fontSize: 17,
|
|
27
|
+
marginBottom: 20,
|
|
28
|
+
textAlign: 'center'
|
|
29
|
+
},
|
|
30
|
+
tokenError: {
|
|
31
|
+
color: colors.white,
|
|
32
|
+
fontSize: 25,
|
|
33
|
+
marginBottom: 10,
|
|
34
|
+
textAlign: 'center'
|
|
35
|
+
},
|
|
36
|
+
})
|
|
37
|
+
|
|
38
|
+
if (!logosource) {
|
|
39
|
+
logosource = require('../assets/logo.png');
|
|
40
|
+
}
|
|
10
41
|
|
|
11
42
|
return (
|
|
12
43
|
<View style={styles.container}>
|
|
13
|
-
<Image style={styles.logo} source={
|
|
44
|
+
<Image style={styles.logo} source={logosource} />
|
|
14
45
|
<Text style={styles.tokenError}>{tokenError}</Text>
|
|
15
46
|
<Text style={styles.resendText}>You will need a fresh acivation email in order to continue creating your account.</Text>
|
|
16
47
|
<Button color={'primary'} title={'Resend email'} onPress={submitCallback}/>
|
|
@@ -18,32 +49,6 @@ function ResendActivationScreen({tokenError, submitCallback}) {
|
|
|
18
49
|
);
|
|
19
50
|
}
|
|
20
51
|
|
|
21
|
-
const styles = StyleSheet.create({
|
|
22
|
-
container: {
|
|
23
|
-
flex: 1,
|
|
24
|
-
justifyContent: 'center',
|
|
25
|
-
},
|
|
26
|
-
logo: {
|
|
27
|
-
width: 150,
|
|
28
|
-
height: 105,
|
|
29
|
-
alignSelf: "center",
|
|
30
|
-
marginTop: 50,
|
|
31
|
-
marginBottom: 20,
|
|
32
|
-
},
|
|
33
|
-
resendText: {
|
|
34
|
-
color: colors.white,
|
|
35
|
-
fontSize: 17,
|
|
36
|
-
marginBottom: 20,
|
|
37
|
-
textAlign: 'center'
|
|
38
|
-
},
|
|
39
|
-
tokenError: {
|
|
40
|
-
color: colors.white,
|
|
41
|
-
fontSize: 25,
|
|
42
|
-
marginBottom: 10,
|
|
43
|
-
textAlign: 'center'
|
|
44
|
-
},
|
|
45
|
-
})
|
|
46
|
-
|
|
47
52
|
export default ResendActivationScreen;
|
|
48
53
|
|
|
49
54
|
|
|
@@ -10,11 +10,15 @@ const validationSchema = Yup.object().shape({
|
|
|
10
10
|
confirm: Yup.string().required().oneOf([Yup.ref('password'), null], 'Passwords must match').label('Confirm')
|
|
11
11
|
});
|
|
12
12
|
|
|
13
|
-
function SetPasswordScreen({submitCallback, error}) {
|
|
13
|
+
function SetPasswordScreen({submitCallback, error, logosource}) {
|
|
14
|
+
if (!logosource) {
|
|
15
|
+
logosource = require('../assets/logo.png');
|
|
16
|
+
}
|
|
17
|
+
|
|
14
18
|
|
|
15
19
|
return(
|
|
16
20
|
<View style={styles.container}>
|
|
17
|
-
<Image style={styles.logo} source={
|
|
21
|
+
<Image style={styles.logo} source={logosource} />
|
|
18
22
|
<Form
|
|
19
23
|
initialValues={{ password: '', confirm: ''}}
|
|
20
24
|
onSubmit={submitCallback}
|
package/screens/UploadScreen.tsx
CHANGED
|
@@ -3,9 +3,11 @@ import {Modal, StyleSheet, View} from "react-native";
|
|
|
3
3
|
import * as Progress from 'react-native-progress';
|
|
4
4
|
|
|
5
5
|
import Animation from "../components/Animation";
|
|
6
|
-
import
|
|
6
|
+
import useColors from "../hooks/useColors";
|
|
7
7
|
|
|
8
8
|
function UploadScreen({onDone, progress = 0, visible = false, animationSource = '../../../../assets/animations/done.json'}) {
|
|
9
|
+
const colors = useColors();
|
|
10
|
+
|
|
9
11
|
return (
|
|
10
12
|
<Modal visible={visible}>
|
|
11
13
|
<View style={styles.container}>
|
|
@@ -5,8 +5,7 @@ import {Image, StyleSheet, Text, View} from "react-native";
|
|
|
5
5
|
import ActivityIndicator from "../components/ActivityIndicator";
|
|
6
6
|
import Background from '../components/Background';
|
|
7
7
|
import Button from '../components/Button';
|
|
8
|
-
|
|
9
|
-
import colors from '../../../../config/colors';
|
|
8
|
+
import useColors from "@boneframework/native-components/hooks/useColors";
|
|
10
9
|
|
|
11
10
|
function WelcomeScreen({
|
|
12
11
|
loginOnPress = () => {},
|
|
@@ -16,8 +15,10 @@ function WelcomeScreen({
|
|
|
16
15
|
logoTopMargin = 70,
|
|
17
16
|
logoWidth = 150,
|
|
18
17
|
logoHeight = 105,
|
|
19
|
-
backgroundSource = null
|
|
18
|
+
backgroundSource = null,
|
|
19
|
+
logoSource = null,
|
|
20
20
|
}) {
|
|
21
|
+
const colors = useColors();
|
|
21
22
|
const styles = StyleSheet.create({
|
|
22
23
|
background: {
|
|
23
24
|
flex: 1,
|
|
@@ -46,11 +47,19 @@ function WelcomeScreen({
|
|
|
46
47
|
},
|
|
47
48
|
});
|
|
48
49
|
|
|
50
|
+
if (!backgroundSource) {
|
|
51
|
+
backgroundSource = require('../assets/background.png');
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
if (!logoSource) {
|
|
55
|
+
logoSource = require('../assets/logo.png');
|
|
56
|
+
}
|
|
57
|
+
|
|
49
58
|
return (
|
|
50
59
|
<Background imageSource={backgroundSource} blurRadius={10} style={styles.background} gradientColors={colors.bgGradient}>
|
|
51
60
|
<ActivityIndicator visible={isLoading} type={'overlay'} />
|
|
52
61
|
<View style={styles.logoContainer}>
|
|
53
|
-
<Image style={styles.logo} source={require(
|
|
62
|
+
<Image style={styles.logo} source={require(logoSource)} />
|
|
54
63
|
<Text style={styles.tagline}>{ title }</Text>
|
|
55
64
|
</View>
|
|
56
65
|
<View style={styles.buttonContainer}>
|
package/api/notifications.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import client from './client';
|
|
2
|
-
|
|
3
|
-
const register = pushToken => client.post('/api/notifications/register-token', {token: pushToken});
|
|
4
|
-
|
|
5
|
-
const send = (message, data) => {
|
|
6
|
-
return client.post('/api/notifications/send-notification', {message, data})
|
|
7
|
-
};
|
|
8
|
-
|
|
9
|
-
export default {
|
|
10
|
-
register, send
|
|
11
|
-
};
|
package/api/users.js
DELETED
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import client from './client';
|
|
2
|
-
|
|
3
|
-
const activateAccount = (email, token, clientId, password) => client.post('/api/user/activate', {email: email, token: token, clientId: clientId, password: password});
|
|
4
|
-
const getProfile = token => client.get('/api/user/profile', {}, {
|
|
5
|
-
headers: { 'Authorization': 'Bearer ' + token},
|
|
6
|
-
});
|
|
7
|
-
const register = userInfo => client.post('/api/user/register', userInfo);
|
|
8
|
-
const resendactivationEmail = email => client.post('/api/user/resend-activation-email', {email: email});
|
|
9
|
-
const updateProfile = profileInfo => client.put('/api/user/profile', profileInfo);
|
|
10
|
-
const validateEmailToken = (email, token) => client.post('/api/user/validate-email-token', {email: email, token: token});
|
|
11
|
-
const uploadUserImage = formData => client.post('/api/user/image', formData, {
|
|
12
|
-
headers: { 'Content-Type': 'multipart/form-data'},
|
|
13
|
-
});
|
|
14
|
-
const userImage = () => client.get('/api/user/image');
|
|
15
|
-
const userSettings = () => client.get('/api/user/settings');
|
|
16
|
-
const updateUserSettings = settings => client.put('/api/user/settings', settings);
|
|
17
|
-
const uploadUserBackgroundImage = formData => client.post('/api/user/background-image', formData, {
|
|
18
|
-
headers: { 'Content-Type': 'multipart/form-data' },
|
|
19
|
-
});
|
|
20
|
-
const userBackgroundImage = () => client.get('/api/user/background-image');
|
|
21
|
-
|
|
22
|
-
export default {
|
|
23
|
-
activateAccount,
|
|
24
|
-
getProfile,
|
|
25
|
-
register,
|
|
26
|
-
resendactivationEmail,
|
|
27
|
-
updateProfile,
|
|
28
|
-
uploadUserImage,
|
|
29
|
-
uploadUserBackgroundImage,
|
|
30
|
-
userBackgroundImage,
|
|
31
|
-
userImage,
|
|
32
|
-
userSettings,
|
|
33
|
-
updateUserSettings,
|
|
34
|
-
validateEmailToken
|
|
35
|
-
};
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import ColorContext from "@boneframework/native-components/contexts/colors";
|
|
2
|
-
import { defaultTheme, ThemeColors } from "@boneframework/native-components/contexts/theme";
|
|
3
|
-
|
|
4
|
-
const ColorProvider = ({value, children}: {value?: ThemeColors; children: React.ReactNode}) => {
|
|
5
|
-
return <ColorContext value={value ?? defaultTheme}>
|
|
6
|
-
{children}
|
|
7
|
-
</ColorContext>;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export default ColorProvider;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import {View} from "react-native";
|
|
3
|
-
import {useFormikContext} from "formik";
|
|
4
|
-
|
|
5
|
-
import ErrorMessage from './ErrorMessage'
|
|
6
|
-
import ImageInputList from '../ImageInputList'
|
|
7
|
-
|
|
8
|
-
function FormImagePicker({ name }) {
|
|
9
|
-
const {setFieldValue, touched, values, errors} = useFormikContext();
|
|
10
|
-
const imageUris = values[name]
|
|
11
|
-
const handleAdd = (uri) => {
|
|
12
|
-
setFieldValue(name, [...imageUris, uri])
|
|
13
|
-
};
|
|
14
|
-
const handleRemove = (uri) => {
|
|
15
|
-
setFieldValue(name, imageUris.filter(imageUri => imageUri !== uri))
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
return (
|
|
19
|
-
<View>
|
|
20
|
-
<ImageInputList
|
|
21
|
-
imageUris={imageUris}
|
|
22
|
-
onAddImage={handleAdd}
|
|
23
|
-
onRemoveImage={handleRemove}
|
|
24
|
-
/>
|
|
25
|
-
<ErrorMessage error={errors[name]} visible={touched[name]} />
|
|
26
|
-
</View>
|
|
27
|
-
);
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
export default FormImagePicker;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|