Improve page indicators, adding items
This commit is contained in:
@ -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)
|
||||
)
|
||||
}
|
||||
}
|
33
CHDataManagement/Views/Generic/TextIndicator.swift
Normal file
33
CHDataManagement/Views/Generic/TextIndicator.swift
Normal 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)
|
||||
)
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user