texts, icons, footers

This commit is contained in:
Evgeny Poberezkin
2026-06-30 20:56:43 +01:00
parent 633a95dbe6
commit 21170a1db5
7 changed files with 26 additions and 18 deletions
@@ -215,9 +215,6 @@ private func handleTextTaps(
s.enumerateAttributes(in: NSRange(location: 0, length: s.length)) { attrs, range, stop in
if index >= range.location && index < range.location + range.length {
if attrs[nameAttrKey] is SimplexNameInfo {
// Route the tapped name through the same connect flow as a link;
// planAndConnect resolves it on the core (name target). This runs
// in a free function with no view context, so use the global theme.
planAndConnect(s.attributedSubstring(from: range).string, theme: AppTheme.shared, dismiss: false)
} else if let url = attrs[linkAttrKey] as? String {
linkURL = url
@@ -250,8 +250,8 @@ struct GroupChatInfoView: View {
if groupInfo.groupProfile.publicGroup != nil {
NavigationLink {
SetSimplexNameView(
titleKey: "Set SimpleX name",
footer: "Set a SimpleX name so people can find this channel as #name. The name must be registered to this channel's address.",
titleKey: "SimpleX name",
footer: "Let people join via name registered with this channel link.",
prefix: "#",
nameText: groupInfo.groupProfile.publicGroup?.publicGroupAccess?.simplexName?.shortName ?? "",
save: { name in
@@ -270,7 +270,7 @@ struct GroupChatInfoView: View {
}
)
} label: {
Label("Set SimpleX name", systemImage: "checkmark.shield")
Label("SimpleX name", systemImage: "number")
}
}
}
@@ -22,7 +22,7 @@ enum UserPickerSheet: Identifiable {
var navigationTitle: LocalizedStringKey {
switch self {
case .address: "SimpleX address and name"
case .address: "SimpleX address"
case .chatPreferences: "Your preferences"
case .chatProfiles: "Your chat profiles"
case .currentProfile: "Your current profile"
@@ -194,8 +194,8 @@ struct UserAddressView: View {
Section {
NavigationLink {
SetSimplexNameView(
titleKey: "Set SimpleX name",
footer: "Set a SimpleX name so people can connect to you using @yourname instead of a link. The name must already be registered to your address.",
titleKey: "Your SimpleX name",
footer: "Let people connect to you via name registered with your SimpleX address.",
prefix: "@",
nameText: chatModel.currentUser?.profile.simplexName?.shortName ?? "",
save: { name in
@@ -209,7 +209,7 @@ struct UserAddressView: View {
}
)
} label: {
Label("Set SimpleX name", systemImage: "checkmark.shield")
Label("Your SimpleX name", systemImage: "at")
}
}
@@ -731,6 +731,8 @@ struct SetSimplexNameView: View {
TextField(prefix + "name.simplex", text: $nameText)
.autocorrectionDisabled(true)
.textInputAutocapitalization(.never)
} header: {
Text(verbatim: "")
} footer: {
Text(footer).foregroundColor(theme.colors.secondary)
}
@@ -756,6 +758,7 @@ struct SetSimplexNameView: View {
}
}
.navigationTitle(titleKey)
.navigationBarTitleDisplayMode(.large)
.alert(isPresented: $showAlert) {
Alert(title: Text("Error saving name"), message: Text(alertMessage))
}
@@ -827,8 +827,8 @@ fun ModalData.GroupChatInfoLayout(
ChannelWebPageButton(groupInfo, manageWebPage)
if (groupInfo.groupProfile.publicGroup != null) {
SettingsActionItem(
painterResource(MR.images.ic_verified_user),
stringResource(MR.strings.set_simplex_name),
painterResource(MR.images.ic_tag),
stringResource(MR.strings.simplex_name),
setSimplexName,
iconColor = MaterialTheme.colors.secondary
)
@@ -357,9 +357,16 @@ private fun UserAddressLayout(
// ShareViaEmailButton { sendEmail(userAddress) }
BusinessAddressToggle(addressSettingsState) { saveAddressSettings(addressSettingsState.value, savedAddressSettingsState) }
AddressSettingsButton(user, userAddress, shareViaProfile, setProfileAddress, saveAddressSettings)
}
if (addressSettingsState.value.businessAddress) {
SectionTextFooter(stringResource(MR.strings.add_your_team_members_to_conversations))
}
SectionDividerSpaced()
SectionView {
SettingsActionItem(
painterResource(MR.images.ic_verified_user),
stringResource(MR.strings.set_simplex_name),
painterResource(MR.images.ic_at),
stringResource(MR.strings.your_simplex_name),
click = {
ModalManager.start.showCustomModal { close ->
SetSimplexNameView(
@@ -384,9 +391,6 @@ private fun UserAddressLayout(
iconColor = MaterialTheme.colors.secondary
)
}
if (addressSettingsState.value.businessAddress) {
SectionTextFooter(stringResource(MR.strings.add_your_team_members_to_conversations))
}
SectionDividerSpaced()
SectionView(generalGetString(MR.strings.or_to_share_privately)) {
@@ -940,10 +940,12 @@
<string name="paste_link">Paste link</string>
<string name="one_time_link">One-time invitation link</string>
<string name="one_time_link_short">1-time link</string>
<string name="simplex_address">SimpleX address and name</string>
<string name="simplex_address">SimpleX address</string>
<string name="verify_simplex_name_action">Verify name</string>
<string name="verify_simplex_names">Verify SimpleX names</string>
<string name="simplex_name_not_verified">SimpleX name not verified</string>
<string name="simplex_name">SimpleX name</string>
<string name="your_simplex_name">Your SimpleX name</string>
<string name="set_simplex_name">Set SimpleX name</string>
<string name="simplex_name_placeholder">name.simplex</string>
<string name="error_saving_simplex_name">Error saving name</string>
@@ -951,6 +953,8 @@
<string name="simplex_name_owner_no_address">The SimpleX name %1$s is registered without SimpleX address. Add your SimpleX address to the name via the registration page.</string>
<string name="set_user_simplex_name_footer">Set a SimpleX name so people can connect to you using @yourname instead of a link. The name must already be registered to your address.</string>
<string name="set_channel_simplex_name_footer">Set a SimpleX name so people can find this channel as #name. The name must be registered to this channel\'s address.</string>
<string name="set_user_simplex_name_footer">Let people connect to you via name registered with your SimpleX address.</string>
<string name="set_channel_simplex_name_footer">Let people join via name registered with this channel link.</string>
<string name="or_show_this_qr_code">Or show this code</string>
<string name="full_link_button_text">Full link</string>
<string name="short_link_button_text">Short link</string>