This commit is contained in:
Max Goedjen 2022-03-04 21:49:46 -08:00
parent 4cab679abd
commit 9fe1f0ca50
No known key found for this signature in database
GPG Key ID: E58C21DD77B9B8E8

View File

@ -64,10 +64,10 @@ struct CreateSecretView<StoreType: SecretStoreModifiable>: View {
} }
} }
struct ThumbnailPickerView: View { struct ThumbnailPickerView<SelectionValue>: View where SelectionValue: Hashable {
let items: [Item] private let items: [Item]
@Binding var selection: Item @Binding private var selection: SelectionValue
var body: some View { var body: some View {
HStack { HStack {
@ -75,19 +75,17 @@ struct ThumbnailPickerView: View {
VStack { VStack {
item.thumbnail item.thumbnail
.frame(width: 250, height: 200) .frame(width: 250, height: 200)
.clipShape(RoundedRectangle(cornerRadius: 10)) .clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
.overlay(RoundedRectangle(cornerRadius: 10) .overlay(RoundedRectangle(cornerRadius: 10)
.stroke(lineWidth: item.id == selection.id ? 5 : 0)) .stroke(lineWidth: item == selection ? 5 : 0))
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
Text(item.name) Text(item.name)
.bold() .bold()
Text(item.description) Text(item.description)
}.onTapGesture { }.onTapGesture {
selection = item selection = item.thumbnail.
} }
} }
}.onAppear {
selection = items.first!
} }
} }
@ -204,20 +202,15 @@ struct NotificationView: View {
.resizable() .resizable()
.frame(width: 64, height: 64) .frame(width: 64, height: 64)
.foregroundColor(.primary) .foregroundColor(.primary)
.padding()
VStack(alignment: .leading) { VStack(alignment: .leading) {
Text("Secretive") Text("Secretive")
.font(.largeTitle) .font(.title)
.foregroundColor(.primary) .foregroundColor(.primary)
Text("Secretive wants to sign some request") Text("Secretive wants to sign")
.font(.title3) .font(.body)
.foregroundColor(.primary)
Text("Secretive wants to sign some request")
.font(.title3)
.foregroundColor(.primary) .foregroundColor(.primary)
} }
.padding() }.padding()
}
.redacted(reason: .placeholder) .redacted(reason: .placeholder)
.background( .background(
RoundedRectangle(cornerRadius: 15) RoundedRectangle(cornerRadius: 15)