add min width for footer button in session tableview vc

pull/941/head
Ryan Zhao 2 years ago
parent e49b4ccaa1
commit bd23e7ec4a

@ -79,6 +79,7 @@ class ThreadDisappearingMessagesViewModel: SessionTableViewModel<ThreadDisappear
style: .bordered,
title: "DISAPPERING_MESSAGES_SAVE_TITLE".localized(),
isEnabled: true,
minWidth: 110,
onTap: {
self?.saveChanges()
self?.dismissScreen()

@ -298,6 +298,7 @@ class SessionTableViewController<NavItemId: Equatable, Section: SessionTableSect
self?.footerButton.setTitle(buttonInfo.title, for: .normal)
self?.footerButton.setStyle(buttonInfo.style)
self?.footerButton.isEnabled = buttonInfo.isEnabled
self?.footerButton.set(.width, greaterThanOrEqualTo: buttonInfo.minWidth)
}
self?.onFooterTap = buttonInfo?.onTap

@ -21,18 +21,21 @@ public final class SessionButton: UIButton {
public let style: Style
public let title: String
public let isEnabled: Bool
public let minWidth: CGFloat
public let onTap: () -> ()
public init(
style: Style,
title: String,
isEnabled: Bool,
minWidth: CGFloat = 0,
onTap: @escaping () -> ()
) {
self.style = style
self.title = title
self.isEnabled = isEnabled
self.onTap = onTap
self.minWidth = minWidth
}
}

Loading…
Cancel
Save