jellyflood/Shared/Components/TextPairView.swift
Joe e4fd98c244
[tvOS] Settings Cleanup (#1163)
* Settings Cleanup. Replace strings with labels. Enforce the same font. Ensure Forms don't get clipped by their boundries. Create consistent, reusable button sizing/coloring. Apply to all Settings Pages.

* Remove custom Button/Form styling in exchange for just using .scrollClipDisabled()

* Swap back to Jellyfin Purple from Purple.

* Remove Check Button. Check all Section Inits where possible. Make Server Details Server non-focusable.

Create a new menu for Server Details selection. This is a WIP awaiting feedback from https://github.com/jellyfin/Swiftfin/pull/1163#discussion_r1705957885

---------

Co-authored-by: Joseph Kribs <joseph@kribs.net>
2024-08-06 20:56:24 -06:00

41 lines
857 B
Swift

//
// Swiftfin is subject to the terms of the Mozilla Public
// License, v2.0. If a copy of the MPL was not distributed with this
// file, you can obtain one at https://mozilla.org/MPL/2.0/.
//
// Copyright (c) 2024 Jellyfin & Jellyfin Contributors
//
import SwiftUI
// TODO: steal from SwiftUI, rename to something like
// `LabeledContentView` with `label` and `value`
struct TextPairView: View {
let leading: String
let trailing: String
var body: some View {
HStack {
Text(leading)
.foregroundColor(.primary)
Spacer()
Text(trailing)
.foregroundColor(.secondary)
}
}
}
extension TextPairView {
init(_ textPair: TextPair) {
self.init(
leading: textPair.title,
trailing: textPair.subtitle
)
}
}