mirror of
https://github.com/maxgoedjen/secretive.git
synced 2026-03-06 17:57:23 +01:00
Missing secrets help (#671)
This commit is contained in:
@@ -66,7 +66,7 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||
Text(.createSecretBiometryCurrentWarning)
|
||||
.padding(.horizontal, 10)
|
||||
.padding(.vertical, 3)
|
||||
.background(.red.opacity(0.5), in: RoundedRectangle(cornerRadius: 5))
|
||||
.boxBackground(color: .red)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -85,7 +85,7 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
|
||||
Text(.createSecretMldsaWarning)
|
||||
.padding(.horizontal, 10)
|
||||
.padding(.vertical, 3)
|
||||
.background(.red.opacity(0.5), in: RoundedRectangle(cornerRadius: 5))
|
||||
.boxBackground(color: .orange)
|
||||
}
|
||||
}
|
||||
VStack(alignment: .leading) {
|
||||
|
||||
@@ -27,7 +27,9 @@ struct EmptyStoreImmutableView: View {
|
||||
}
|
||||
|
||||
struct EmptyStoreModifiableView: View {
|
||||
|
||||
|
||||
@Environment(\.justUpdatedChecker) var justUpdatedChecker
|
||||
|
||||
var body: some View {
|
||||
GeometryReader { windowGeometry in
|
||||
VStack {
|
||||
@@ -51,6 +53,21 @@ struct EmptyStoreModifiableView: View {
|
||||
}.frame(height: (windowGeometry.size.height/2) - 20).padding()
|
||||
Text(.emptyStoreModifiableClickHereTitle).bold()
|
||||
Text(.emptyStoreModifiableClickHereDescription)
|
||||
if justUpdatedChecker.justUpdatedOS {
|
||||
Spacer()
|
||||
.frame(height: 20)
|
||||
VStack(spacing: 10) {
|
||||
Text(.emptyStoreModifiableEmptyOsWarningTitle)
|
||||
.font(.title2)
|
||||
.bold()
|
||||
Text(.emptyStoreModifiableEmptyOsWarningDescription)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
.bold()
|
||||
}
|
||||
.padding()
|
||||
.boxBackground(color: .orange)
|
||||
.padding()
|
||||
}
|
||||
Spacer()
|
||||
}.frame(maxWidth: .infinity, maxHeight: .infinity)
|
||||
}
|
||||
@@ -61,6 +78,10 @@ struct EmptyStoreModifiableView: View {
|
||||
#Preview {
|
||||
EmptyStoreImmutableView()
|
||||
}
|
||||
#Preview {
|
||||
EmptyStoreImmutableView()
|
||||
// .environment(\.justUpdatedChecker, <#T##value: V##V#>)
|
||||
}
|
||||
#Preview {
|
||||
EmptyStoreModifiableView()
|
||||
}
|
||||
|
||||
32
Sources/Secretive/Views/Styles/BoxBackgroundStyle.swift
Normal file
32
Sources/Secretive/Views/Styles/BoxBackgroundStyle.swift
Normal file
@@ -0,0 +1,32 @@
|
||||
import SwiftUI
|
||||
|
||||
struct BoxBackgroundModifier: ViewModifier {
|
||||
|
||||
let color: Color
|
||||
|
||||
func body(content: Content) -> some View {
|
||||
content
|
||||
.background {
|
||||
RoundedRectangle(cornerRadius: 5)
|
||||
.fill(color.opacity(0.3))
|
||||
.stroke(color, lineWidth: 1)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
extension View {
|
||||
|
||||
func boxBackground(color: Color) -> some View {
|
||||
modifier(BoxBackgroundModifier(color: color))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#Preview {
|
||||
Text("Hello")
|
||||
.boxBackground(color: .red)
|
||||
.padding()
|
||||
Text("Hello")
|
||||
.boxBackground(color: .orange)
|
||||
.padding()
|
||||
}
|
||||
Reference in New Issue
Block a user