Skip to content
Snippets Groups Projects
Commit 6ae2c881 authored by Bruno Muniz's avatar Bruno Muniz :apple:
Browse files

Merge branch 'fix/create-group-subdrawer' into 'dev'

Fix create group subdrawer

See merge request elixxir/client-ios!107
parents f3638c2a af1c8e7c
No related branches found
No related tags found
1 merge request!107Fix create group subdrawer
...@@ -994,6 +994,10 @@ ...@@ -994,6 +994,10 @@
= "Create Group"; = "Create Group";
"createGroup.drawer.subtitle" "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."; = "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" "createGroup.drawer.input"
= "Group Name"; = "Group Name";
"createGroup.drawer.otherInput" "createGroup.drawer.otherInput"
......
...@@ -613,6 +613,8 @@ public enum Localized { ...@@ -613,6 +613,8 @@ public enum Localized {
public static let action = Localized.tr("Localizable", "createGroup.drawer.action") public static let action = Localized.tr("Localizable", "createGroup.drawer.action")
/// Cancel /// Cancel
public static let cancel = Localized.tr("Localizable", "createGroup.drawer.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 /// Group Name
public static let input = Localized.tr("Localizable", "createGroup.drawer.input") public static let input = Localized.tr("Localizable", "createGroup.drawer.input")
/// Needs to be 20 chars max or 256 bytes /// Needs to be 20 chars max or 256 bytes
...@@ -623,6 +625,8 @@ public enum Localized { ...@@ -623,6 +625,8 @@ public enum Localized {
public static let otherInput = Localized.tr("Localizable", "createGroup.drawer.otherInput") public static let otherInput = Localized.tr("Localizable", "createGroup.drawer.otherInput")
/// Say hi to your friends! /// Say hi to your friends!
public static let otherPlaceholder = Localized.tr("Localizable", "createGroup.drawer.otherPlaceholder") 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 /// Secret Family
public static let placeholder = Localized.tr("Localizable", "createGroup.drawer.placeholder") 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. /// You are about to create a group message with other %@ users. The information below will be visible to all members of the group.
......
import UIKit import UIKit
import Shared
import Combine import Combine
import XXModels import XXModels
import Dependencies
import AppResources
import AppNavigation
import DrawerFeature
public final class CreateGroupController: UIViewController { public final class CreateGroupController: UIViewController {
@Dependency(\.navigator) var navigator
private lazy var screenView = CreateGroupView() private lazy var screenView = CreateGroupView()
private let groupMembers: [Contact] private let groupMembers: [Contact]
private let viewModel = CreateGroupViewModel() private let viewModel = CreateGroupViewModel()
private var cancellables = Set<AnyCancellable>() private var cancellables = Set<AnyCancellable>()
private var drawerCancellables = Set<AnyCancellable>()
public init(_ groupMembers: [Contact]) { public init(_ groupMembers: [Contact]) {
self.groupMembers = groupMembers self.groupMembers = groupMembers
...@@ -22,7 +30,44 @@ public final class CreateGroupController: UIViewController { ...@@ -22,7 +30,44 @@ public final class CreateGroupController: UIViewController {
public override func viewDidLoad() { public override func viewDidLoad() {
super.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 viewModel
.statePublisher .statePublisher
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment