Improve page indicators, adding items

This commit is contained in:
Christoph Hagen
2025-01-09 13:27:38 +01:00
parent 0590224f02
commit 0db6e411c3
23 changed files with 238 additions and 206 deletions

View File

@ -1,15 +0,0 @@
import SwiftUI
struct DraftIndicator: View {
var body: some View {
Text("Draft")
.foregroundStyle(.white)
.padding(.vertical, 2)
.padding(.horizontal, 5)
.background(
RoundedRectangle(cornerRadius: 5, style: .circular)
.foregroundStyle(Color.gray)
)
}
}

View File

@ -0,0 +1,33 @@
import SwiftUI
struct TextIndicator: View {
let text: LocalizedStringKey
let color: Color
let background: Color
init(text: String, color: Color = .white, background: Color = Color.gray) {
self.text = .init(stringLiteral: text)
self.background = background
self.color = color
}
init(text: LocalizedStringKey, color: Color = .white, background: Color = Color.gray) {
self.text = text
self.background = background
self.color = color
}
var body: some View {
Text(text)
.foregroundStyle(color)
.padding(.vertical, 2)
.padding(.horizontal, 5)
.background(
RoundedRectangle(cornerRadius: 5, style: .circular)
.foregroundStyle(background)
)
}
}