2021-11-10 15:10:34 +00:00
|
|
|
import { StackNavigationProp } from '@react-navigation/stack';
|
|
|
|
import React from 'react';
|
|
|
|
|
2022-03-09 18:10:36 +00:00
|
|
|
import { ProfileStackParamList } from '../stacks/types';
|
2022-04-07 16:27:45 +00:00
|
|
|
import { IUser } from './IUser';
|
2021-11-10 15:10:34 +00:00
|
|
|
|
|
|
|
export interface IParams {
|
|
|
|
name: string;
|
|
|
|
username: string;
|
|
|
|
email: string | null;
|
|
|
|
newPassword: string;
|
|
|
|
currentPassword: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface IAvatarButton {
|
2022-01-12 12:54:04 +00:00
|
|
|
key: string;
|
2021-11-10 15:10:34 +00:00
|
|
|
child: React.ReactNode;
|
2022-01-12 12:54:04 +00:00
|
|
|
onPress: () => void;
|
2021-11-10 15:10:34 +00:00
|
|
|
disabled: boolean;
|
|
|
|
}
|
|
|
|
|
|
|
|
export interface INavigationOptions {
|
2021-12-03 19:27:57 +00:00
|
|
|
navigation: StackNavigationProp<ProfileStackParamList, 'ProfileView'>;
|
2021-11-10 15:10:34 +00:00
|
|
|
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;
|
|
|
|
}
|
|
|
|
|
2022-03-10 12:25:25 +00:00
|
|
|
export interface IAvatarSuggestion {
|
|
|
|
[service: string]: {
|
|
|
|
url: string;
|
|
|
|
blob: string;
|
|
|
|
contentType: string;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
|
2021-11-10 15:10:34 +00:00
|
|
|
export interface IProfileViewState {
|
|
|
|
saving: boolean;
|
|
|
|
name: string;
|
|
|
|
username: string;
|
|
|
|
email: string | null;
|
|
|
|
newPassword: string | null;
|
|
|
|
currentPassword: string | null;
|
|
|
|
avatarUrl: string | null;
|
|
|
|
avatar: IAvatar;
|
2022-03-10 12:25:25 +00:00
|
|
|
avatarSuggestions: IAvatarSuggestion;
|
2021-11-10 15:10:34 +00:00
|
|
|
customFields: {
|
|
|
|
[key: string | number]: string;
|
|
|
|
};
|
|
|
|
}
|