Cleaned up various things, mostly removed unnecessary selfs, comments and bad formatting

This commit is contained in:
Stefan Ceriu
2022-09-26 18:21:34 +03:00
committed by Stefan Ceriu
parent c073dfd95d
commit eac1401cc1
39 changed files with 141 additions and 350 deletions
@@ -17,9 +17,6 @@
import SwiftUI
struct UserSessionListItem: View {
// MARK: - Constants
private enum LayoutConstants {
static let horizontalPadding: CGFloat = 15
static let verticalPadding: CGFloat = 16
@@ -27,23 +24,16 @@ struct UserSessionListItem: View {
static let avatarRightMargin: CGFloat = 18
}
// MARK: - Properties
// MARK: Private
@Environment(\.theme) private var theme: ThemeSwiftUI
// MARK: Public
let viewData: UserSessionListItemViewData
var onBackgroundTap: ((String) -> (Void))? = nil
// MARK: - Body
var body: some View {
Button(action: { onBackgroundTap?(self.viewData.sessionId)
}) {
Button {
onBackgroundTap?(viewData.sessionId)
} label: {
VStack(alignment: .leading, spacing: LayoutConstants.verticalPadding) {
HStack(spacing: LayoutConstants.avatarRightMargin) {
DeviceAvatarView(viewData: viewData.deviceAvatarViewData)
@@ -74,7 +64,6 @@ struct UserSessionListItem: View {
}
struct UserSessionListPreview: View {
let userSessionsOverviewService: UserSessionsOverviewServiceProtocol = MockUserSessionsOverviewService()
var body: some View {