mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-16 22:48:34 +02:00
Merge commit 'af0b6d4be985d9f26e5111d3fa01389c7321949f' into feature/7276_FOSS_Merge_1_27_11 # Conflicts: # Config/AppVersion.xcconfig # Gemfile.lock # IDETemplateMacros.plist # Podfile # Podfile.lock # README.md # Riot/Modules/Authentication/AuthenticationCoordinator.swift # Riot/Modules/Room/CellData/RoomBubbleCellData.m # Riot/target.yml # RiotNSE/NotificationService.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/AuthenticationServerSelectionModels.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/AuthenticationServerSelectionViewModel.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/Coordinator/AuthenticationServerSelectionCoordinator.swift # RiotSwiftUI/Modules/Authentication/ServerSelection/View/AuthenticationServerSelectionScreen.swift # RiotSwiftUI/Modules/Room/CompletionSuggestion/Service/CompletionSuggestionService.swift # fastlane/Fastfile
59 lines
1.8 KiB
Swift
59 lines
1.8 KiB
Swift
//
|
|
// Copyright 2022-2024 New Vector Ltd.
|
|
//
|
|
// SPDX-License-Identifier: AGPL-3.0-only OR LicenseRef-Element-Commercial
|
|
// Please see LICENSE files in the repository root for full details.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
/// A view that shows information about the chosen homeserver,
|
|
/// along with an edit button to pick a different one.
|
|
struct AuthenticationServerInfoSection: View {
|
|
// MARK: - Private
|
|
|
|
@Environment(\.theme) private var theme
|
|
|
|
// MARK: - Public
|
|
|
|
let address: String
|
|
let flow: AuthenticationFlow
|
|
let editAction: () -> Void
|
|
|
|
var title: String {
|
|
flow == .login ? VectorL10n.authenticationServerInfoTitleLogin : VectorL10n.authenticationServerInfoTitle
|
|
}
|
|
|
|
// MARK: - Views
|
|
|
|
var body: some View {
|
|
VStack(alignment: .leading, spacing: 4) {
|
|
if !BWIBuildSettings.shared.bumLoginFlowLayout {
|
|
Text(title)
|
|
.font(theme.fonts.subheadline)
|
|
.foregroundColor(theme.colors.secondaryContent)
|
|
}
|
|
|
|
HStack {
|
|
|
|
Text(address)
|
|
.font(theme.fonts.body)
|
|
.foregroundColor(theme.colors.secondaryContent)
|
|
|
|
if !BWIBuildSettings.shared.bumLoginFlowLayout {
|
|
|
|
Spacer()
|
|
|
|
Button(action: editAction) {
|
|
Text(VectorL10n.edit)
|
|
.font(theme.fonts.body)
|
|
.padding(.horizontal, 12)
|
|
.padding(.vertical, 6)
|
|
.overlay(RoundedRectangle(cornerRadius: 8).stroke(theme.colors.accent))
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|
|
}
|