mirror of
https://github.com/simplex-chat/simplex-chat.git
synced 2026-05-25 14:14:39 +00:00
AddGroupView/AddChannelView: wrap action buttons + toggles in SectionView card
In Create group and Create public channel screens the action buttons (Create / Configure relays) and incognito toggle were rendered as loose SectionItemViews on the gray canvas with no card chrome. Wrap them in SectionView so they read as a single card matching the iOS-style facelift. The display-name input above and the descriptive footer below stay outside the card (text input keeps its own padding, footer reads as caption). Added missing `import SectionView` in AddGroupView. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
+22
-20
@@ -311,27 +311,29 @@ private fun ProfileStepView(
|
||||
}
|
||||
Spacer(Modifier.height(8.dp))
|
||||
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_wifi_tethering),
|
||||
generalGetString(MR.strings.configure_relays),
|
||||
click = {
|
||||
ModalManager.start.showCustomModal { close ->
|
||||
NetworkAndServersView(close)
|
||||
}
|
||||
},
|
||||
textColor = if (hasRelays.value) MaterialTheme.colors.primary else WarningOrange,
|
||||
iconColor = if (hasRelays.value) MaterialTheme.colors.primary else WarningOrange
|
||||
)
|
||||
SectionView {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_wifi_tethering),
|
||||
generalGetString(MR.strings.configure_relays),
|
||||
click = {
|
||||
ModalManager.start.showCustomModal { close ->
|
||||
NetworkAndServersView(close)
|
||||
}
|
||||
},
|
||||
textColor = if (hasRelays.value) MaterialTheme.colors.primary else WarningOrange,
|
||||
iconColor = if (hasRelays.value) MaterialTheme.colors.primary else WarningOrange
|
||||
)
|
||||
|
||||
val canCreate = canCreateProfile(displayName.value) && hasRelays.value && !creationInProgress.value
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_check),
|
||||
generalGetString(MR.strings.create_channel_button),
|
||||
click = createChannel,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
disabled = !canCreate
|
||||
)
|
||||
val canCreate = canCreateProfile(displayName.value) && hasRelays.value && !creationInProgress.value
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_check),
|
||||
generalGetString(MR.strings.create_channel_button),
|
||||
click = createChannel,
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
disabled = !canCreate
|
||||
)
|
||||
}
|
||||
|
||||
SectionTextFooter(
|
||||
if (!hasRelays.value) {
|
||||
|
||||
+20
-17
@@ -1,6 +1,7 @@
|
||||
package chat.simplex.common.views.newchat
|
||||
|
||||
import SectionTextFooter
|
||||
import SectionView
|
||||
import androidx.compose.desktop.ui.tooling.preview.Preview
|
||||
import androidx.compose.foundation.*
|
||||
import androidx.compose.foundation.layout.*
|
||||
@@ -150,24 +151,26 @@ fun AddGroupLayout(
|
||||
}
|
||||
Spacer(Modifier.height(8.dp))
|
||||
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_check),
|
||||
stringResource(MR.strings.create_group_button),
|
||||
click = {
|
||||
createGroup(incognito.value, GroupProfile(
|
||||
displayName = displayName.value.trim(),
|
||||
fullName = "",
|
||||
shortDescr = null,
|
||||
image = profileImage.value,
|
||||
groupPreferences = GroupPreferences(history = GroupPreference(GroupFeatureEnabled.ON))
|
||||
))
|
||||
},
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
disabled = !canCreateProfile(displayName.value)
|
||||
)
|
||||
SectionView {
|
||||
SettingsActionItem(
|
||||
painterResource(MR.images.ic_check),
|
||||
stringResource(MR.strings.create_group_button),
|
||||
click = {
|
||||
createGroup(incognito.value, GroupProfile(
|
||||
displayName = displayName.value.trim(),
|
||||
fullName = "",
|
||||
shortDescr = null,
|
||||
image = profileImage.value,
|
||||
groupPreferences = GroupPreferences(history = GroupPreference(GroupFeatureEnabled.ON))
|
||||
))
|
||||
},
|
||||
textColor = MaterialTheme.colors.primary,
|
||||
iconColor = MaterialTheme.colors.primary,
|
||||
disabled = !canCreateProfile(displayName.value)
|
||||
)
|
||||
|
||||
IncognitoToggle(incognitoPref, incognito) { ModalManager.start.showModal { IncognitoView() } }
|
||||
IncognitoToggle(incognitoPref, incognito) { ModalManager.start.showModal { IncognitoView() } }
|
||||
}
|
||||
|
||||
SectionTextFooter(
|
||||
buildAnnotatedString {
|
||||
|
||||
Reference in New Issue
Block a user