Skip to content

Commit

Permalink
Small tidy up for duplicate sections.
Browse files Browse the repository at this point in the history
  • Loading branch information
pixlwave committed Jan 30, 2023
1 parent 4d67e67 commit 8ff9122
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 80 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,9 @@ class SessionVerificationViewModel: SessionVerificationViewModelType, SessionVer
case (_, .cancel, .cancelling):
self.cancelVerification()
case (_, _, .verified):
DispatchQueue.main.asyncAfter(deadline: .now() + 2) {
// Dismiss the success screen automatically.
Task {
try await Task.sleep(for: .seconds(2))
self.callback?(.finished)
}
default:
Expand Down
79 changes: 0 additions & 79 deletions ElementX/Sources/Screens/Settings/View/SettingsScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,6 @@ struct SettingsScreen: View {

signOutSection
.listRowBackground(rowBackgroundColor)

// analyticsSection
// .listRowBackground(rowBackgroundColor)
//
// userInterfaceSection
// .listRowBackground(rowBackgroundColor)
//
// logoutSection
// .listRowBackground(rowBackgroundColor)
}
.introspectTableView { tableView in
tableView.backgroundColor = .clear
Expand Down Expand Up @@ -160,76 +151,6 @@ struct SettingsScreen: View {
.padding(.top, 24)
}
}

private var analyticsSection: some View {
Section {
Button { context.send(viewAction: .reportBug) } label: {
HStack {
Text(ElementL10n.sendBugReport)
Spacer()
Image(systemName: "chevron.forward")
.foregroundColor(.element.tertiaryContent)
}
}
.listRowInsets(listRowInsets)
.listRowSeparator(.hidden)
.foregroundColor(.element.primaryContent)
.accessibilityIdentifier("reportBugButton")
}
}

@ViewBuilder
private var userInterfaceSection: some View {
Section {
Picker(ElementL10n.settingsTimelineStyle, selection: $settings.timelineStyle) {
ForEach(TimelineStyle.allCases, id: \.self) { style in
Text(style.description)
.tag(style)
}
}
.listRowInsets(listRowInsets)
.accessibilityIdentifier("timelineStylePicker")
}
}

private var logoutSection: some View {
Section {
Button { showingLogoutConfirmation = true } label: {
HStack {
Image(systemName: "rectangle.portrait.and.arrow.right")
.foregroundColor(.element.systemGray)
.padding(4)
.background(Color.element.systemGray6)
.clipShape(Circle())
.frame(width: menuIconSize, height: menuIconSize)
Text(ElementL10n.actionSignOut)
Spacer()
Image(systemName: "chevron.forward")
.foregroundColor(.element.tertiaryContent)
}
}
.listRowInsets(listRowInsets)
.foregroundColor(.element.primaryContent)
.accessibilityIdentifier("logoutButton")
.alert(ElementL10n.actionSignOut,
isPresented: $showingLogoutConfirmation) {
Button(ElementL10n.actionSignOut,
role: .destructive,
action: logout)
} message: {
Text(ElementL10n.actionSignOutConfirmationSimple)
}
} footer: {
VStack {
versionText
.frame(maxWidth: .infinity)

if let deviceId = context.viewState.deviceID {
Text(deviceId)
}
}
}
}

private var closeButton: some View {
Button(ElementL10n.actionCancel, action: close)
Expand Down

0 comments on commit 8ff9122

Please sign in to comment.