diff --git a/Sources/AppResources/Resources/en.lproj/Localizable.strings b/Sources/AppResources/Resources/en.lproj/Localizable.strings index e7a3f3836bdb268cc32463801f23dcd3ce209afa..dfbda6df6911829ff5382b72cd90923b7d56dca1 100644 --- a/Sources/AppResources/Resources/en.lproj/Localizable.strings +++ b/Sources/AppResources/Resources/en.lproj/Localizable.strings @@ -994,6 +994,10 @@ = "Create Group"; "createGroup.drawer.subtitle" = "You are about to create a group message with other %@ users. The information below will be visible to all members of the group."; +"createGroup.drawer.otherSubtitle" += "A group request will be sent to every user who can choose to join or not. Group chat requests are secured and sent via the xx network cMix protocol. However, due to the inherent batching associated with communicating with many people and current implementation details, it should not be considered as private as a standard, peer-to-peer chat."; +"createGroup.drawer.gotit" += "Got it"; "createGroup.drawer.input" = "Group Name"; "createGroup.drawer.otherInput" diff --git a/Sources/AppResources/Strings.swift b/Sources/AppResources/Strings.swift index c04bc9971e61f56ff66cc7d03736e5dfa5d21695..32f6386535d5d9b95f283a00a44f48b3d3244aa0 100644 --- a/Sources/AppResources/Strings.swift +++ b/Sources/AppResources/Strings.swift @@ -613,6 +613,8 @@ public enum Localized { public static let action = Localized.tr("Localizable", "createGroup.drawer.action") /// Cancel public static let cancel = Localized.tr("Localizable", "createGroup.drawer.cancel") + /// Got it + public static let gotit = Localized.tr("Localizable", "createGroup.drawer.gotit") /// Group Name public static let input = Localized.tr("Localizable", "createGroup.drawer.input") /// Needs to be 20 chars max or 256 bytes @@ -623,6 +625,8 @@ public enum Localized { public static let otherInput = Localized.tr("Localizable", "createGroup.drawer.otherInput") /// Say hi to your friends! public static let otherPlaceholder = Localized.tr("Localizable", "createGroup.drawer.otherPlaceholder") + /// A group request will be sent to every user who can choose to join or not. Group chat requests are secured and sent via the xx network cMix protocol. However, due to the inherent batching associated with communicating with many people and current implementation details, it should not be considered as private as a standard, peer-to-peer chat. + public static let otherSubtitle = Localized.tr("Localizable", "createGroup.drawer.otherSubtitle") /// Secret Family public static let placeholder = Localized.tr("Localizable", "createGroup.drawer.placeholder") /// You are about to create a group message with other %@ users. The information below will be visible to all members of the group. diff --git a/Sources/CreateGroupFeature/CreateGroupController.swift b/Sources/CreateGroupFeature/CreateGroupController.swift index ad7303364f56d0dbd7b840f3803cb066f8be2578..d7f68171f4814f90d50381f3eeb9e13271b6d457 100644 --- a/Sources/CreateGroupFeature/CreateGroupController.swift +++ b/Sources/CreateGroupFeature/CreateGroupController.swift @@ -1,13 +1,21 @@ import UIKit +import Shared import Combine import XXModels +import Dependencies +import AppResources +import AppNavigation +import DrawerFeature public final class CreateGroupController: UIViewController { + @Dependency(\.navigator) var navigator + private lazy var screenView = CreateGroupView() private let groupMembers: [Contact] private let viewModel = CreateGroupViewModel() private var cancellables = Set<AnyCancellable>() + private var drawerCancellables = Set<AnyCancellable>() public init(_ groupMembers: [Contact]) { self.groupMembers = groupMembers @@ -22,7 +30,44 @@ public final class CreateGroupController: UIViewController { public override func viewDidLoad() { super.viewDidLoad() - screenView.set(count: groupMembers.count, didTap: {}) + screenView.set(count: groupMembers.count, didTap: { [weak self] in + guard let self else { return } + + let actionButton = CapsuleButton() + actionButton.setStyle(.seeThrough) + actionButton.setTitle(Localized.CreateGroup.Drawer.gotit, for: .normal) + + actionButton + .publisher(for: .touchUpInside) + .receive(on: DispatchQueue.main) + .sink { [unowned self] in + self.navigator.perform(DismissModal(from: self)) { [weak self] in + guard let self else { return } + self.drawerCancellables.removeAll() + } + }.store(in: &self.drawerCancellables) + + self.navigator.perform(PresentDrawer(items: [ + DrawerText( + font: Fonts.Mulish.bold.font(size: 26.0), + text: Localized.CreateGroup.Drawer.title, + color: Asset.neutralActive.color, + alignment: .left, + spacingAfter: 19 + ), + DrawerText( + font: Fonts.Mulish.regular.font(size: 16.0), + text: Localized.CreateGroup.Drawer.otherSubtitle, + color: Asset.neutralDark.color, + alignment: .left, + spacingAfter: 20 + ), + DrawerStack(views: [ + actionButton, + FlexibleSpace() + ]) + ], isDismissable: true, from: self)) + }) viewModel .statePublisher