interfaces.ts 1.54 KB
Newer Older
1
2
3
import { StackNavigationProp } from '@react-navigation/stack';
import React from 'react';

4
5
import { ProfileStackParamList } from '../../stacks/types';

6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
export interface IUser {
	id: string;
	name: string;
	username: string;
	emails: {
		[index: number]: {
			address: string;
		};
	};
	customFields: {
		[index: string | number]: string;
	};
}

export interface IParams {
	name: string;
	username: string;
	email: string | null;
	newPassword: string;
	currentPassword: string;
}

export interface IAvatarButton {
	key: React.Key;
	child: React.ReactNode;
	onPress: Function;
	disabled: boolean;
}

export interface INavigationOptions {
36
	navigation: StackNavigationProp<ProfileStackParamList, 'ProfileView'>;
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
	isMasterDetail?: boolean;
}

export interface IProfileViewProps {
	user: IUser;
	baseUrl: string;
	Accounts_AllowEmailChange: boolean;
	Accounts_AllowPasswordChange: boolean;
	Accounts_AllowRealNameChange: boolean;
	Accounts_AllowUserAvatarChange: boolean;
	Accounts_AllowUsernameChange: boolean;
	Accounts_CustomFields: string;
	setUser: Function;
	theme: string;
}

export interface IAvatar {
	data: {} | string | null;
	url?: string;
	contentType?: string;
	service?: any;
}

export interface IProfileViewState {
	saving: boolean;
	name: string;
	username: string;
	email: string | null;
	newPassword: string | null;
	currentPassword: string | null;
	avatarUrl: string | null;
	avatar: IAvatar;
	avatarSuggestions: {
		[service: string]: {
			url: string;
			blob: string;
			contentType: string;
		};
	};
	customFields: {
		[key: string | number]: string;
	};
}