@magicred-1/react-native-lxmf 0.2.47 → 0.2.49
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.
|
@@ -89,9 +89,9 @@ function ContactRow({ contact, onPress }: Readonly<{ contact: Contact; onPress:
|
|
|
89
89
|
type GroupModalProps = {
|
|
90
90
|
visible: boolean;
|
|
91
91
|
onClose: () => void;
|
|
92
|
-
onCreated: (addrHex: string
|
|
92
|
+
onCreated: (addrHex: string) => void;
|
|
93
93
|
onJoined: (addrHex: string) => void;
|
|
94
|
-
createGroup: (name: string) => string;
|
|
94
|
+
createGroup: (name: string) => { addrHex: string; keyHex: string };
|
|
95
95
|
joinGroup: (addrHex: string, keyHex: string) => boolean;
|
|
96
96
|
};
|
|
97
97
|
|
|
@@ -101,7 +101,7 @@ function GroupModal({ visible, onClose, onCreated, onJoined, createGroup, joinGr
|
|
|
101
101
|
const [joinAddr, setJoinAddr] = useState('');
|
|
102
102
|
const [joinKey, setJoinKey] = useState('');
|
|
103
103
|
const [err, setErr] = useState('');
|
|
104
|
-
const [created, setCreated] = useState<{ addrHex: string; name: string } | null>(null);
|
|
104
|
+
const [created, setCreated] = useState<{ addrHex: string; keyHex: string; name: string } | null>(null);
|
|
105
105
|
|
|
106
106
|
const reset = () => {
|
|
107
107
|
setCreateName('');
|
|
@@ -118,8 +118,8 @@ function GroupModal({ visible, onClose, onCreated, onJoined, createGroup, joinGr
|
|
|
118
118
|
const name = createName.trim();
|
|
119
119
|
if (!name) { setErr('Enter a group name.'); return; }
|
|
120
120
|
try {
|
|
121
|
-
const addrHex = createGroup(name);
|
|
122
|
-
setCreated({ addrHex, name });
|
|
121
|
+
const { addrHex, keyHex } = createGroup(name);
|
|
122
|
+
setCreated({ addrHex, keyHex, name });
|
|
123
123
|
setErr('');
|
|
124
124
|
} catch (e: any) {
|
|
125
125
|
setErr(e?.message ?? 'Failed to create group.');
|
|
@@ -137,7 +137,7 @@ function GroupModal({ visible, onClose, onCreated, onJoined, createGroup, joinGr
|
|
|
137
137
|
};
|
|
138
138
|
|
|
139
139
|
const handleDone = () => {
|
|
140
|
-
if (created) onCreated(created.addrHex
|
|
140
|
+
if (created) onCreated(created.addrHex);
|
|
141
141
|
handleClose();
|
|
142
142
|
};
|
|
143
143
|
|
|
@@ -184,14 +184,15 @@ function GroupModal({ visible, onClose, onCreated, onJoined, createGroup, joinGr
|
|
|
184
184
|
|
|
185
185
|
{tab === 'create' && created && (
|
|
186
186
|
<>
|
|
187
|
-
<Text style={S.modalHint}>Group created. Share
|
|
187
|
+
<Text style={S.modalHint}>Group created. Share address + key with members — both are required to join.</Text>
|
|
188
188
|
<View style={S.inviteBox}>
|
|
189
189
|
<Text style={S.inviteLabel}>Name</Text>
|
|
190
190
|
<Text selectable style={S.inviteValue}>{created.name}</Text>
|
|
191
|
-
<Text style={S.inviteLabel}>Address</Text>
|
|
191
|
+
<Text style={S.inviteLabel}>Address (32 hex)</Text>
|
|
192
192
|
<Text selectable style={S.inviteValue}>{created.addrHex}</Text>
|
|
193
|
+
<Text style={S.inviteLabel}>Key (64 hex)</Text>
|
|
194
|
+
<Text selectable style={S.inviteValue}>{created.keyHex}</Text>
|
|
193
195
|
</View>
|
|
194
|
-
<Text style={S.modalHint}>Members need the address AND key (tap Share to send both).</Text>
|
|
195
196
|
<View style={S.modalBtns}>
|
|
196
197
|
<Pressable style={[S.modalBtn, S.modalBtnCancel]} onPress={handleDone}>
|
|
197
198
|
<Text style={S.modalBtnText}>Open Chat</Text>
|