@ethora/chat-component-rn 26.10.0 → 26.10.2
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/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +14 -12
- package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +41 -39
- package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +137 -50
- package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +15 -13
- package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +57 -55
- package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +15 -1
- package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +61 -59
- package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +8 -3
- package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/commonjs/hooks/useLogout.js +15 -10
- package/lib/commonjs/hooks/useLogout.js.map +1 -1
- package/lib/commonjs/i18n/strings.js +24 -0
- package/lib/commonjs/i18n/strings.js.map +1 -1
- package/lib/commonjs/networking/api-requests/user.api.js +32 -3
- package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
- package/lib/commonjs/roomStore/chatSettingsSlice.js +6 -0
- package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/commonjs/version.js +1 -1
- package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +15 -13
- package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +42 -40
- package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +138 -52
- package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +16 -14
- package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +58 -56
- package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +14 -0
- package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +62 -60
- package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +9 -4
- package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
- package/lib/module/hooks/useLogout.js +15 -10
- package/lib/module/hooks/useLogout.js.map +1 -1
- package/lib/module/i18n/strings.js +24 -0
- package/lib/module/i18n/strings.js.map +1 -1
- package/lib/module/networking/api-requests/user.api.js +31 -3
- package/lib/module/networking/api-requests/user.api.js.map +1 -1
- package/lib/module/roomStore/chatSettingsSlice.js +6 -0
- package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
- package/lib/module/version.js +1 -1
- package/lib/typescript/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +1 -0
- package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
- package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.d.ts.map +1 -1
- package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
- package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
- package/lib/typescript/i18n/strings.d.ts.map +1 -1
- package/lib/typescript/networking/api-requests/user.api.d.ts +8 -0
- package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
- package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
- package/lib/typescript/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.tsx +20 -17
- package/src/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.tsx +58 -55
- package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +156 -62
- package/src/components/Modals/SettingsModals/ProfileShares/ProfileShares.tsx +22 -19
- package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +48 -45
- package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +11 -0
- package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +63 -60
- package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +11 -3
- package/src/hooks/useLogout.tsx +15 -10
- package/src/i18n/strings.ts +24 -0
- package/src/networking/api-requests/user.api.ts +28 -2
- package/src/roomStore/chatSettingsSlice.ts +6 -0
- package/src/version.ts +1 -1
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
SharedSettingsLabelData,
|
|
23
23
|
SharedSettingsInfoPanel,
|
|
24
24
|
SharedSettingsInfoText,
|
|
25
|
+
SharedSettingsScrollBody,
|
|
25
26
|
} from '../SharedStyledComponents';
|
|
26
27
|
|
|
27
28
|
interface BlockedUsersModalProps {
|
|
@@ -39,23 +40,25 @@ const BlockedUsersModal: React.FC<BlockedUsersModalProps> = ({
|
|
|
39
40
|
handleCloseModal={handleCloseModal}
|
|
40
41
|
headerTitle={'Blocke Users'}
|
|
41
42
|
/>
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
<
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
43
|
+
<SharedSettingsScrollBody>
|
|
44
|
+
<SharedSettingsSectionContainer>
|
|
45
|
+
<SharedSettingsStyledLabel>
|
|
46
|
+
Current Document Shares
|
|
47
|
+
</SharedSettingsStyledLabel>
|
|
48
|
+
<SharedSettingsLabelData>
|
|
49
|
+
Listed below are your currently active document sharing links. You can
|
|
50
|
+
share or delete them.
|
|
51
|
+
</SharedSettingsLabelData>
|
|
52
|
+
<BorderedContainer>
|
|
53
|
+
<SharedSettingsInfoPanel bgColor={config?.colors?.secondary}>
|
|
54
|
+
<SharedSettingsInfoText>
|
|
55
|
+
There are no shares yet, or you can add them by clicking the “Add
|
|
56
|
+
New Share” button
|
|
57
|
+
</SharedSettingsInfoText>
|
|
58
|
+
</SharedSettingsInfoPanel>
|
|
59
|
+
</BorderedContainer>
|
|
60
|
+
</SharedSettingsSectionContainer>
|
|
61
|
+
</SharedSettingsScrollBody>
|
|
59
62
|
</ModalContainerFullScreen>
|
|
60
63
|
);
|
|
61
64
|
};
|
|
@@ -30,6 +30,7 @@ import {
|
|
|
30
30
|
SharedSettingsInfoPanel,
|
|
31
31
|
SharedSettingsInfoText,
|
|
32
32
|
SharedSettingsColumnContainer,
|
|
33
|
+
SharedSettingsScrollBody,
|
|
33
34
|
} from '../SharedStyledComponents';
|
|
34
35
|
import { SearchInput } from '../../../InputComponents/Search';
|
|
35
36
|
import Button from '../../../styled/Button';
|
|
@@ -51,63 +52,65 @@ const DocumentSharesModal: React.FC<DocumentSharesModalProps> = ({
|
|
|
51
52
|
handleCloseModal={handleCloseModal}
|
|
52
53
|
headerTitle={'Document Shares'}
|
|
53
54
|
/>
|
|
54
|
-
<
|
|
55
|
-
<
|
|
56
|
-
<
|
|
57
|
-
<
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
<
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
<View>
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
55
|
+
<SharedSettingsScrollBody>
|
|
56
|
+
<CenterContainer>
|
|
57
|
+
<SharedSettingsColumnContainer>
|
|
58
|
+
<SharedSettingsSectionContainer>
|
|
59
|
+
<SharedSettingsStyledLabel>
|
|
60
|
+
Current Document Shares
|
|
61
|
+
</SharedSettingsStyledLabel>
|
|
62
|
+
<SharedSettingsLabelData>
|
|
63
|
+
Listed below are your currently active document sharing links. You
|
|
64
|
+
can share or delete them.
|
|
65
|
+
</SharedSettingsLabelData>
|
|
66
|
+
<BorderedContainer>
|
|
67
|
+
<View
|
|
68
|
+
style={{
|
|
69
|
+
display: 'flex',
|
|
70
|
+
padding: 8,
|
|
71
|
+
width: '100%',
|
|
72
|
+
justifyContent: 'space-between',
|
|
73
|
+
alignItems: 'center',
|
|
74
|
+
}}
|
|
75
|
+
>
|
|
76
|
+
<View>List of shares</View>
|
|
77
|
+
<View style={{ display: 'flex', flexDirection: 'row' }}>
|
|
78
|
+
<View>
|
|
79
|
+
{/* <SearchInput
|
|
80
|
+
animated
|
|
81
|
+
icon={<SearchIcon />}
|
|
82
|
+
direction="right"
|
|
83
|
+
/> */}
|
|
84
|
+
</View>
|
|
85
|
+
<View>
|
|
86
|
+
<DropdownMenu
|
|
87
|
+
sortFunction={function (value: string): void {
|
|
88
|
+
throw new Error('Function not implemented.');
|
|
89
|
+
}}
|
|
90
|
+
icon={''}
|
|
91
|
+
values={['Name', 'Surname']}
|
|
92
|
+
/>
|
|
93
|
+
</View>
|
|
94
|
+
<Button
|
|
95
|
+
variant="filled"
|
|
96
|
+
StartIcon={<PlusIcon />}
|
|
97
|
+
style={{ width: '100%' }}
|
|
98
|
+
>
|
|
99
|
+
Add New Share
|
|
100
|
+
</Button>
|
|
82
101
|
</View>
|
|
83
|
-
<View>
|
|
84
|
-
<DropdownMenu
|
|
85
|
-
sortFunction={function (value: string): void {
|
|
86
|
-
throw new Error('Function not implemented.');
|
|
87
|
-
}}
|
|
88
|
-
icon={''}
|
|
89
|
-
values={['Name', 'Surname']}
|
|
90
|
-
/>
|
|
91
|
-
</View>
|
|
92
|
-
<Button
|
|
93
|
-
variant="filled"
|
|
94
|
-
StartIcon={<PlusIcon />}
|
|
95
|
-
style={{ width: '100%' }}
|
|
96
|
-
>
|
|
97
|
-
Add New Share
|
|
98
|
-
</Button>
|
|
99
102
|
</View>
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
</
|
|
106
|
-
</
|
|
107
|
-
</
|
|
108
|
-
</
|
|
109
|
-
</
|
|
110
|
-
</
|
|
103
|
+
<SharedSettingsInfoPanel bgColor={config?.colors?.secondary}>
|
|
104
|
+
<SharedSettingsInfoText>
|
|
105
|
+
There are no shares yet, or you can add them by clicking the
|
|
106
|
+
“Add New Share” button
|
|
107
|
+
</SharedSettingsInfoText>
|
|
108
|
+
</SharedSettingsInfoPanel>
|
|
109
|
+
</BorderedContainer>
|
|
110
|
+
</SharedSettingsSectionContainer>
|
|
111
|
+
</SharedSettingsColumnContainer>
|
|
112
|
+
</CenterContainer>
|
|
113
|
+
</SharedSettingsScrollBody>
|
|
111
114
|
</ModalContainerFullScreen>
|
|
112
115
|
);
|
|
113
116
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { useState } from 'react';
|
|
2
2
|
import {
|
|
3
3
|
LabelData,
|
|
4
4
|
ModalContainerFullScreen,
|
|
@@ -8,7 +8,10 @@ import { useSelector } from 'react-redux';
|
|
|
8
8
|
import { RootState } from '../../../../roomStore';
|
|
9
9
|
import styled from 'styled-components/native';
|
|
10
10
|
import { InfoIcon } from '../../../../assets/icons';
|
|
11
|
-
import {
|
|
11
|
+
import {
|
|
12
|
+
deleteMe,
|
|
13
|
+
downloadMyDataExport,
|
|
14
|
+
} from '../../../../networking/api-requests/user.api';
|
|
12
15
|
import {
|
|
13
16
|
SharedSettingsCenterContainer,
|
|
14
17
|
SharedSettingsColumnContainer,
|
|
@@ -18,10 +21,14 @@ import {
|
|
|
18
21
|
SharedSettingsSectionContainer,
|
|
19
22
|
SharedSettingsStyledButton,
|
|
20
23
|
SharedSettingsStyledLabel,
|
|
24
|
+
SharedSettingsScrollBody,
|
|
21
25
|
} from '../SharedStyledComponents';
|
|
22
|
-
import { View } from 'react-native';
|
|
26
|
+
import { Alert, Platform, Share, View } from 'react-native';
|
|
27
|
+
import * as FileSystem from 'expo-file-system/legacy';
|
|
23
28
|
import { useTheme } from '../../../../hooks/useTheme';
|
|
24
29
|
import { useT } from '../../../../i18n/useT';
|
|
30
|
+
import { useLogout } from '../../../../hooks/useLogout';
|
|
31
|
+
import { useToast } from '../../../../context/ToastContext';
|
|
25
32
|
|
|
26
33
|
interface ManageDataModalProps {
|
|
27
34
|
handleCloseModal: any;
|
|
@@ -42,19 +49,101 @@ const ManageDataModal: React.FC<ManageDataModalProps> = ({
|
|
|
42
49
|
const theme = useTheme();
|
|
43
50
|
const t = useT();
|
|
44
51
|
|
|
52
|
+
const performLogout = useLogout();
|
|
53
|
+
const { showToast } = useToast();
|
|
54
|
+
const [isDownloading, setIsDownloading] = useState(false);
|
|
55
|
+
const [isDeleting, setIsDeleting] = useState(false);
|
|
56
|
+
|
|
57
|
+
const showError = (message: string) =>
|
|
58
|
+
showToast({
|
|
59
|
+
id: Date.now().toString(),
|
|
60
|
+
title: t('toast.error'),
|
|
61
|
+
message,
|
|
62
|
+
type: 'error',
|
|
63
|
+
});
|
|
64
|
+
|
|
45
65
|
const handleDownloadClick = async () => {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
66
|
+
if (isDownloading) {return;}
|
|
67
|
+
setIsDownloading(true);
|
|
68
|
+
try {
|
|
69
|
+
const fileName = 'my-data.json';
|
|
70
|
+
const download = await downloadMyDataExport(
|
|
71
|
+
`${FileSystem.cacheDirectory}${fileName}`
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
if (Platform.OS === 'android') {
|
|
75
|
+
// Android has no shareable file URL; let the user pick a folder
|
|
76
|
+
// through the Storage Access Framework and write the copy there.
|
|
77
|
+
const saf = (FileSystem as any).StorageAccessFramework;
|
|
78
|
+
const perm = await saf.requestDirectoryPermissionsAsync();
|
|
79
|
+
if (!perm.granted) {return;}
|
|
80
|
+
const base64 = await FileSystem.readAsStringAsync(download.uri, {
|
|
81
|
+
encoding: FileSystem.EncodingType.Base64,
|
|
82
|
+
});
|
|
83
|
+
const destUri = await saf.createFileAsync(
|
|
84
|
+
perm.directoryUri,
|
|
85
|
+
fileName.replace(/\.[^/.]+$/, ''),
|
|
86
|
+
download.mimeType || 'application/json'
|
|
87
|
+
);
|
|
88
|
+
await FileSystem.writeAsStringAsync(destUri, base64, {
|
|
89
|
+
encoding: FileSystem.EncodingType.Base64,
|
|
90
|
+
});
|
|
91
|
+
showToast({
|
|
92
|
+
id: Date.now().toString(),
|
|
93
|
+
title: t('toast.successTitle'),
|
|
94
|
+
message: t('toast.saveSuccessful'),
|
|
95
|
+
type: 'success',
|
|
96
|
+
});
|
|
97
|
+
return;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
// iOS: the share sheet offers "Save to Files", AirDrop, etc. and is
|
|
101
|
+
// itself the confirmation, so no success toast.
|
|
102
|
+
await Share.share({ url: download.uri, title: fileName });
|
|
103
|
+
} catch (err) {
|
|
104
|
+
console.error('ManageDataModal: data export failed', err);
|
|
105
|
+
showError(t('settings.manageData.downloadFailed'));
|
|
106
|
+
} finally {
|
|
107
|
+
setIsDownloading(false);
|
|
108
|
+
}
|
|
109
|
+
};
|
|
110
|
+
|
|
111
|
+
const deleteAccount = async () => {
|
|
112
|
+
setIsDeleting(true);
|
|
113
|
+
try {
|
|
114
|
+
await deleteMe();
|
|
115
|
+
} catch (err) {
|
|
116
|
+
console.error('ManageDataModal: account deletion failed', err);
|
|
117
|
+
showError(t('settings.manageData.deleteFailed'));
|
|
118
|
+
setIsDeleting(false);
|
|
119
|
+
return;
|
|
120
|
+
}
|
|
121
|
+
// The account is gone server-side: tear the local session down the
|
|
122
|
+
// same way a logout does, then let the host navigate away.
|
|
123
|
+
await performLogout();
|
|
124
|
+
try {
|
|
125
|
+
await config?.logout?.onAfterLogout?.();
|
|
126
|
+
} catch (e) {
|
|
127
|
+
console.warn('ManageDataModal: onAfterLogout threw', e);
|
|
128
|
+
}
|
|
129
|
+
};
|
|
130
|
+
|
|
131
|
+
const handleDeleteClick = () => {
|
|
132
|
+
if (isDeleting) {return;}
|
|
133
|
+
Alert.alert(
|
|
134
|
+
t('settings.manageData.deleteConfirmTitle'),
|
|
135
|
+
t('settings.manageData.deleteConfirmMessage'),
|
|
136
|
+
[
|
|
137
|
+
{ text: t('action.cancel'), style: 'cancel' },
|
|
138
|
+
{
|
|
139
|
+
text: t('action.delete'),
|
|
140
|
+
style: 'destructive',
|
|
141
|
+
onPress: () => {
|
|
142
|
+
deleteAccount();
|
|
143
|
+
},
|
|
144
|
+
},
|
|
145
|
+
]
|
|
146
|
+
);
|
|
58
147
|
};
|
|
59
148
|
|
|
60
149
|
return (
|
|
@@ -63,54 +152,59 @@ const ManageDataModal: React.FC<ManageDataModalProps> = ({
|
|
|
63
152
|
handleCloseModal={handleCloseModal}
|
|
64
153
|
headerTitle={t('settings.manageData.title')}
|
|
65
154
|
/>
|
|
66
|
-
<
|
|
67
|
-
<
|
|
68
|
-
<
|
|
69
|
-
<
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
155
|
+
<SharedSettingsScrollBody>
|
|
156
|
+
<SharedSettingsCenterContainer>
|
|
157
|
+
<SharedSettingsColumnContainer>
|
|
158
|
+
<SharedSettingsSectionContainer>
|
|
159
|
+
<SharedSettingsStyledLabel>
|
|
160
|
+
{t('settings.manageData.downloadLabel')}
|
|
161
|
+
</SharedSettingsStyledLabel>
|
|
162
|
+
<LabelData
|
|
163
|
+
style={{
|
|
164
|
+
fontSize: 12,
|
|
165
|
+
textAlign: 'left',
|
|
166
|
+
}}
|
|
167
|
+
>
|
|
168
|
+
{t('settings.manageData.downloadDescription')}
|
|
169
|
+
</LabelData>
|
|
170
|
+
</SharedSettingsSectionContainer>
|
|
171
|
+
<SharedSettingsStyledButton
|
|
172
|
+
borderColor={theme.primary}
|
|
173
|
+
onPress={handleDownloadClick}
|
|
174
|
+
loading={isDownloading}
|
|
175
|
+
text={t('settings.manageData.downloadLabel')}
|
|
176
|
+
color={theme.primary}
|
|
177
|
+
/>
|
|
178
|
+
</SharedSettingsColumnContainer>
|
|
179
|
+
<SharedSettingsColumnContainer>
|
|
180
|
+
<SharedSettingsSectionContainer>
|
|
181
|
+
<SharedSettingsStyledLabel>
|
|
182
|
+
{t('settings.manageData.deleteLabel')}
|
|
183
|
+
</SharedSettingsStyledLabel>
|
|
184
|
+
<SharedSettingsLabelData>
|
|
185
|
+
{t('settings.manageData.deleteDescription')}
|
|
186
|
+
</SharedSettingsLabelData>
|
|
187
|
+
</SharedSettingsSectionContainer>
|
|
188
|
+
<SharedSettingsInfoPanel
|
|
189
|
+
bgColor={theme.surfaceHighlight}
|
|
77
190
|
>
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
</SharedSettingsLabelData>
|
|
96
|
-
</SharedSettingsSectionContainer>
|
|
97
|
-
<SharedSettingsInfoPanel
|
|
98
|
-
bgColor={config?.colors?.secondary || theme.surfaceHighlight}
|
|
99
|
-
>
|
|
100
|
-
<View>
|
|
101
|
-
<InfoIcon color={theme.primary} />
|
|
102
|
-
</View>
|
|
103
|
-
<SharedSettingsInfoText>
|
|
104
|
-
{t('settings.manageData.deleteDisclosure')}
|
|
105
|
-
</SharedSettingsInfoText>
|
|
106
|
-
</SharedSettingsInfoPanel>
|
|
107
|
-
<SharedSettingsStyledButton
|
|
108
|
-
borderColor={theme.danger}
|
|
109
|
-
text={t('action.deleteMyAccount')}
|
|
110
|
-
color={theme.danger}
|
|
111
|
-
/>
|
|
112
|
-
</SharedSettingsColumnContainer>
|
|
113
|
-
</SharedSettingsCenterContainer>
|
|
191
|
+
<View>
|
|
192
|
+
<InfoIcon color={theme.primary} />
|
|
193
|
+
</View>
|
|
194
|
+
<SharedSettingsInfoText>
|
|
195
|
+
{t('settings.manageData.deleteDisclosure')}
|
|
196
|
+
</SharedSettingsInfoText>
|
|
197
|
+
</SharedSettingsInfoPanel>
|
|
198
|
+
<SharedSettingsStyledButton
|
|
199
|
+
borderColor={theme.danger}
|
|
200
|
+
onPress={handleDeleteClick}
|
|
201
|
+
loading={isDeleting}
|
|
202
|
+
text={t('action.deleteMyAccount')}
|
|
203
|
+
color={theme.danger}
|
|
204
|
+
/>
|
|
205
|
+
</SharedSettingsColumnContainer>
|
|
206
|
+
</SharedSettingsCenterContainer>
|
|
207
|
+
</SharedSettingsScrollBody>
|
|
114
208
|
</ModalContainerFullScreen>
|
|
115
209
|
);
|
|
116
210
|
};
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
SharedSettingsLabelData,
|
|
23
23
|
SharedSettingsSectionContainer,
|
|
24
24
|
SharedSettingsStyledLabel,
|
|
25
|
+
SharedSettingsScrollBody,
|
|
25
26
|
} from '../SharedStyledComponents';
|
|
26
27
|
|
|
27
28
|
interface ProfileSharesModalProps {
|
|
@@ -39,25 +40,27 @@ const ProfileSharesModal: React.FC<ProfileSharesModalProps> = ({
|
|
|
39
40
|
handleCloseModal={handleCloseModal}
|
|
40
41
|
headerTitle={'Profile Shares'}
|
|
41
42
|
/>
|
|
42
|
-
<
|
|
43
|
-
<
|
|
44
|
-
<
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
<
|
|
53
|
-
<
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
43
|
+
<SharedSettingsScrollBody>
|
|
44
|
+
<CenterContainer>
|
|
45
|
+
<SharedSettingsSectionContainer>
|
|
46
|
+
<SharedSettingsStyledLabel>
|
|
47
|
+
Current Profile Shares
|
|
48
|
+
</SharedSettingsStyledLabel>
|
|
49
|
+
<SharedSettingsLabelData>
|
|
50
|
+
Listed below are your currently active profile sharing links. You
|
|
51
|
+
can share or delete them.
|
|
52
|
+
</SharedSettingsLabelData>
|
|
53
|
+
<BorderedContainer>
|
|
54
|
+
<SharedSettingsInfoPanel bgColor={config?.colors?.secondary}>
|
|
55
|
+
<SharedSettingsInfoText>
|
|
56
|
+
There are no shares yet, or you can add them by clicking the
|
|
57
|
+
“Add New Share” button
|
|
58
|
+
</SharedSettingsInfoText>
|
|
59
|
+
</SharedSettingsInfoPanel>
|
|
60
|
+
</BorderedContainer>
|
|
61
|
+
</SharedSettingsSectionContainer>
|
|
62
|
+
</CenterContainer>
|
|
63
|
+
</SharedSettingsScrollBody>
|
|
61
64
|
</ModalContainerFullScreen>
|
|
62
65
|
);
|
|
63
66
|
};
|
|
@@ -15,6 +15,7 @@ import {
|
|
|
15
15
|
RowWrapper,
|
|
16
16
|
SharedSettingsColumnContainer,
|
|
17
17
|
SharedSettingsStyledLabel,
|
|
18
|
+
SharedSettingsScrollBody,
|
|
18
19
|
} from '../SharedStyledComponents';
|
|
19
20
|
import InputWithLabel from '../../../styled/StyledInput';
|
|
20
21
|
import { StyledInput } from '../../../styled/StyledInputComponents/StyledInputComponents';
|
|
@@ -40,51 +41,53 @@ const ReferralsModal: React.FC<ReferralsModalProps> = ({
|
|
|
40
41
|
handleCloseModal={handleCloseModal}
|
|
41
42
|
headerTitle={'Referrals'}
|
|
42
43
|
/>
|
|
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
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
44
|
+
<SharedSettingsScrollBody>
|
|
45
|
+
<CenterContainer>
|
|
46
|
+
<ReferalsIcon />
|
|
47
|
+
<Animated.View>
|
|
48
|
+
<SharedSettingsStyledLabel>Gift friends 25</SharedSettingsStyledLabel>
|
|
49
|
+
<SendCoinIcon style={{ width: 24, height: 24 }} />
|
|
50
|
+
<SharedSettingsStyledLabel>and receive 25</SharedSettingsStyledLabel>
|
|
51
|
+
<SendCoinIcon style={{ width: 24, height: 24 }} />
|
|
52
|
+
<Text style={{ color: theme.text }}>.</Text>
|
|
53
|
+
<SharedSettingsStyledLabel>
|
|
54
|
+
Send friends invite with your personal invitation code.
|
|
55
|
+
</SharedSettingsStyledLabel>
|
|
56
|
+
</Animated.View>
|
|
57
|
+
<SharedSettingsColumnContainer style={{ width: '100%' }}>
|
|
58
|
+
<SharedSettingsStyledLabel>
|
|
59
|
+
Your invitation code
|
|
60
|
+
</SharedSettingsStyledLabel>
|
|
61
|
+
<StyledInput
|
|
62
|
+
{...{ color: config?.colors?.primary || theme.primary } as any}
|
|
63
|
+
placeholder="Your invitation code"
|
|
64
|
+
// label={'About'}
|
|
65
|
+
// value={message}
|
|
66
|
+
// onChange={handleInputChange}
|
|
67
|
+
// onKeyDown={handleKeyDown}
|
|
68
|
+
// onFocus={handleFocus}
|
|
69
|
+
// onBlur={handleBlur}
|
|
70
|
+
// disabled={isLoading}
|
|
71
|
+
/>
|
|
72
|
+
</SharedSettingsColumnContainer>
|
|
73
|
+
<SharedSettingsColumnContainer style={{ width: '100%' }}>
|
|
74
|
+
<SharedSettingsStyledLabel>
|
|
75
|
+
Or enter your referral code to earn coins
|
|
76
|
+
</SharedSettingsStyledLabel>
|
|
77
|
+
<StyledInput
|
|
78
|
+
{...{ color: config?.colors?.primary || theme.primary } as any}
|
|
79
|
+
placeholder="Your referral code"
|
|
80
|
+
// label={'About'}
|
|
81
|
+
// value={message}
|
|
82
|
+
// onChange={handleInputChange}
|
|
83
|
+
// onKeyDown={handleKeyDown}
|
|
84
|
+
// onFocus={handleFocus}
|
|
85
|
+
// onBlur={handleBlur}
|
|
86
|
+
// disabled={isLoading}
|
|
87
|
+
/>
|
|
88
|
+
</SharedSettingsColumnContainer>
|
|
89
|
+
</CenterContainer>
|
|
90
|
+
</SharedSettingsScrollBody>
|
|
88
91
|
</ModalContainerFullScreen>
|
|
89
92
|
);
|
|
90
93
|
};
|
|
@@ -72,3 +72,14 @@ export const SharedSettingsInfoText = styled.Text`
|
|
|
72
72
|
display: flex;
|
|
73
73
|
text-align: start;
|
|
74
74
|
`;
|
|
75
|
+
|
|
76
|
+
// Scrollable body under a settings screen's header: the content is taller
|
|
77
|
+
// than the screen on small phones and in large text sizes, and a plain View
|
|
78
|
+
// just clips it.
|
|
79
|
+
export const SharedSettingsScrollBody = styled.ScrollView.attrs({
|
|
80
|
+
contentContainerStyle: { flexGrow: 1, alignItems: 'center' },
|
|
81
|
+
keyboardShouldPersistTaps: 'handled',
|
|
82
|
+
})`
|
|
83
|
+
flex: 1;
|
|
84
|
+
width: 100%;
|
|
85
|
+
`;
|