@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.
Files changed (79) hide show
  1. package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +14 -12
  2. package/lib/commonjs/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
  3. package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +41 -39
  4. package/lib/commonjs/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
  5. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +137 -50
  6. package/lib/commonjs/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  7. package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +15 -13
  8. package/lib/commonjs/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
  9. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js +57 -55
  10. package/lib/commonjs/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  11. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js +15 -1
  12. package/lib/commonjs/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  13. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js +61 -59
  14. package/lib/commonjs/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  15. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js +8 -3
  16. package/lib/commonjs/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  17. package/lib/commonjs/hooks/useLogout.js +15 -10
  18. package/lib/commonjs/hooks/useLogout.js.map +1 -1
  19. package/lib/commonjs/i18n/strings.js +24 -0
  20. package/lib/commonjs/i18n/strings.js.map +1 -1
  21. package/lib/commonjs/networking/api-requests/user.api.js +32 -3
  22. package/lib/commonjs/networking/api-requests/user.api.js.map +1 -1
  23. package/lib/commonjs/roomStore/chatSettingsSlice.js +6 -0
  24. package/lib/commonjs/roomStore/chatSettingsSlice.js.map +1 -1
  25. package/lib/commonjs/version.js +1 -1
  26. package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js +15 -13
  27. package/lib/module/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.js.map +1 -1
  28. package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js +42 -40
  29. package/lib/module/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.js.map +1 -1
  30. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js +138 -52
  31. package/lib/module/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.js.map +1 -1
  32. package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js +16 -14
  33. package/lib/module/components/Modals/SettingsModals/ProfileShares/ProfileShares.js.map +1 -1
  34. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js +58 -56
  35. package/lib/module/components/Modals/SettingsModals/Referrals/Referrals.js.map +1 -1
  36. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js +14 -0
  37. package/lib/module/components/Modals/SettingsModals/SharedStyledComponents.js.map +1 -1
  38. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js +62 -60
  39. package/lib/module/components/Modals/SettingsModals/Visibility/VisibilityModal.js.map +1 -1
  40. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js +9 -4
  41. package/lib/module/components/Modals/UserSettingsModal/UserSettingsModal.js.map +1 -1
  42. package/lib/module/hooks/useLogout.js +15 -10
  43. package/lib/module/hooks/useLogout.js.map +1 -1
  44. package/lib/module/i18n/strings.js +24 -0
  45. package/lib/module/i18n/strings.js.map +1 -1
  46. package/lib/module/networking/api-requests/user.api.js +31 -3
  47. package/lib/module/networking/api-requests/user.api.js.map +1 -1
  48. package/lib/module/roomStore/chatSettingsSlice.js +6 -0
  49. package/lib/module/roomStore/chatSettingsSlice.js.map +1 -1
  50. package/lib/module/version.js +1 -1
  51. package/lib/typescript/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.d.ts.map +1 -1
  52. package/lib/typescript/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.d.ts.map +1 -1
  53. package/lib/typescript/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.d.ts.map +1 -1
  54. package/lib/typescript/components/Modals/SettingsModals/ProfileShares/ProfileShares.d.ts.map +1 -1
  55. package/lib/typescript/components/Modals/SettingsModals/Referrals/Referrals.d.ts.map +1 -1
  56. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts +1 -0
  57. package/lib/typescript/components/Modals/SettingsModals/SharedStyledComponents.d.ts.map +1 -1
  58. package/lib/typescript/components/Modals/SettingsModals/Visibility/VisibilityModal.d.ts.map +1 -1
  59. package/lib/typescript/components/Modals/UserSettingsModal/UserSettingsModal.d.ts.map +1 -1
  60. package/lib/typescript/hooks/useLogout.d.ts.map +1 -1
  61. package/lib/typescript/i18n/strings.d.ts.map +1 -1
  62. package/lib/typescript/networking/api-requests/user.api.d.ts +8 -0
  63. package/lib/typescript/networking/api-requests/user.api.d.ts.map +1 -1
  64. package/lib/typescript/roomStore/chatSettingsSlice.d.ts.map +1 -1
  65. package/lib/typescript/version.d.ts +1 -1
  66. package/package.json +1 -1
  67. package/src/components/Modals/SettingsModals/BlockedUsers/BlockedUsersModal.tsx +20 -17
  68. package/src/components/Modals/SettingsModals/DocumentShares/DocumentSharesModal.tsx +58 -55
  69. package/src/components/Modals/SettingsModals/ManageDataModal/ManageDataModal.tsx +156 -62
  70. package/src/components/Modals/SettingsModals/ProfileShares/ProfileShares.tsx +22 -19
  71. package/src/components/Modals/SettingsModals/Referrals/Referrals.tsx +48 -45
  72. package/src/components/Modals/SettingsModals/SharedStyledComponents.ts +11 -0
  73. package/src/components/Modals/SettingsModals/Visibility/VisibilityModal.tsx +63 -60
  74. package/src/components/Modals/UserSettingsModal/UserSettingsModal.tsx +11 -3
  75. package/src/hooks/useLogout.tsx +15 -10
  76. package/src/i18n/strings.ts +24 -0
  77. package/src/networking/api-requests/user.api.ts +28 -2
  78. package/src/roomStore/chatSettingsSlice.ts +6 -0
  79. 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
- <SharedSettingsSectionContainer>
43
- <SharedSettingsStyledLabel>
44
- Current Document Shares
45
- </SharedSettingsStyledLabel>
46
- <SharedSettingsLabelData>
47
- Listed below are your currently active document sharing links. You can
48
- share or delete them.
49
- </SharedSettingsLabelData>
50
- <BorderedContainer>
51
- <SharedSettingsInfoPanel bgColor={config?.colors?.secondary}>
52
- <SharedSettingsInfoText>
53
- There are no shares yet, or you can add them by clicking the “Add
54
- New Share” button
55
- </SharedSettingsInfoText>
56
- </SharedSettingsInfoPanel>
57
- </BorderedContainer>
58
- </SharedSettingsSectionContainer>
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
- <CenterContainer>
55
- <SharedSettingsColumnContainer>
56
- <SharedSettingsSectionContainer>
57
- <SharedSettingsStyledLabel>
58
- Current Document Shares
59
- </SharedSettingsStyledLabel>
60
- <SharedSettingsLabelData>
61
- Listed below are your currently active document sharing links. You
62
- can share or delete them.
63
- </SharedSettingsLabelData>
64
- <BorderedContainer>
65
- <View
66
- style={{
67
- display: 'flex',
68
- padding: 8,
69
- width: '100%',
70
- justifyContent: 'space-between',
71
- alignItems: 'center',
72
- }}
73
- >
74
- <View>List of shares</View>
75
- <View style={{ display: 'flex', flexDirection: 'row' }}>
76
- <View>
77
- {/* <SearchInput
78
- animated
79
- icon={<SearchIcon />}
80
- direction="right"
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
- </View>
101
- <SharedSettingsInfoPanel bgColor={config?.colors?.secondary}>
102
- <SharedSettingsInfoText>
103
- There are no shares yet, or you can add them by clicking the
104
- “Add New Share” button
105
- </SharedSettingsInfoText>
106
- </SharedSettingsInfoPanel>
107
- </BorderedContainer>
108
- </SharedSettingsSectionContainer>
109
- </SharedSettingsColumnContainer>
110
- </CenterContainer>
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 { getExportMyData } from '../../../../networking/api-requests/user.api';
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
- // const exportedData = await getExportMyData();
47
- // const binaryData = exportedData.data;
48
- // console.log(binaryData);
49
- // const blob = new Blob([binaryData], { type: "text/plain" });
50
- // const url = URL.createObjectURL(blob);
51
- // const a = document.createElement("a");
52
- // a.href = url;
53
- // a.download = "mydata.json";
54
- // document.body.appendChild(a);
55
- // a.click();
56
- // document.body.removeChild(a);
57
- // URL.revokeObjectURL(url);
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
- <SharedSettingsCenterContainer>
67
- <SharedSettingsColumnContainer>
68
- <SharedSettingsSectionContainer>
69
- <SharedSettingsStyledLabel>
70
- {t('settings.manageData.downloadLabel')}
71
- </SharedSettingsStyledLabel>
72
- <LabelData
73
- style={{
74
- fontSize: 12,
75
- textAlign: 'left',
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
- {t('settings.manageData.downloadDescription')}
79
- </LabelData>
80
- </SharedSettingsSectionContainer>
81
- <SharedSettingsStyledButton
82
- borderColor={theme.primary}
83
- onPress={handleDownloadClick}
84
- text={t('settings.manageData.downloadLabel')}
85
- color={theme.primary}
86
- />
87
- </SharedSettingsColumnContainer>
88
- <SharedSettingsColumnContainer>
89
- <SharedSettingsSectionContainer>
90
- <SharedSettingsStyledLabel>
91
- {t('settings.manageData.deleteLabel')}
92
- </SharedSettingsStyledLabel>
93
- <SharedSettingsLabelData>
94
- {t('settings.manageData.deleteDescription')}
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
- <CenterContainer>
43
- <SharedSettingsSectionContainer>
44
- <SharedSettingsStyledLabel>
45
- Current Profile Shares
46
- </SharedSettingsStyledLabel>
47
- <SharedSettingsLabelData>
48
- Listed below are your currently active profile sharing links. You
49
- can share or delete them.
50
- </SharedSettingsLabelData>
51
- <BorderedContainer>
52
- <SharedSettingsInfoPanel bgColor={config?.colors?.secondary}>
53
- <SharedSettingsInfoText>
54
- There are no shares yet, or you can add them by clicking the
55
- “Add New Share” button
56
- </SharedSettingsInfoText>
57
- </SharedSettingsInfoPanel>
58
- </BorderedContainer>
59
- </SharedSettingsSectionContainer>
60
- </CenterContainer>
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
- <CenterContainer>
44
- <ReferalsIcon />
45
- <Animated.View>
46
- <SharedSettingsStyledLabel>Gift friends 25</SharedSettingsStyledLabel>
47
- <SendCoinIcon style={{ width: 24, height: 24 }} />
48
- <SharedSettingsStyledLabel>and receive 25</SharedSettingsStyledLabel>
49
- <SendCoinIcon style={{ width: 24, height: 24 }} />
50
- <Text style={{ color: theme.text }}>.</Text>
51
- <SharedSettingsStyledLabel>
52
- Send friends invite with your personal invitation code.
53
- </SharedSettingsStyledLabel>
54
- </Animated.View>
55
- <SharedSettingsColumnContainer style={{ width: '100%' }}>
56
- <SharedSettingsStyledLabel>
57
- Your invitation code
58
- </SharedSettingsStyledLabel>
59
- <StyledInput
60
- {...{ color: config?.colors?.primary || theme.primary } as any}
61
- placeholder="Your invitation code"
62
- // label={'About'}
63
- // value={message}
64
- // onChange={handleInputChange}
65
- // onKeyDown={handleKeyDown}
66
- // onFocus={handleFocus}
67
- // onBlur={handleBlur}
68
- // disabled={isLoading}
69
- />
70
- </SharedSettingsColumnContainer>
71
- <SharedSettingsColumnContainer style={{ width: '100%' }}>
72
- <SharedSettingsStyledLabel>
73
- Or enter your referral code to earn coins
74
- </SharedSettingsStyledLabel>
75
- <StyledInput
76
- {...{ color: config?.colors?.primary || theme.primary } as any}
77
- placeholder="Your referral code"
78
- // label={'About'}
79
- // value={message}
80
- // onChange={handleInputChange}
81
- // onKeyDown={handleKeyDown}
82
- // onFocus={handleFocus}
83
- // onBlur={handleBlur}
84
- // disabled={isLoading}
85
- />
86
- </SharedSettingsColumnContainer>
87
- </CenterContainer>
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
+ `;