This commit is contained in:
Max Goedjen 2022-12-18 15:51:47 -08:00
parent 7b3809d296
commit 0df1efb28b
No known key found for this signature in database
1 changed files with 7 additions and 5 deletions

View File

@ -74,27 +74,29 @@ struct ThumbnailPickerView<ValueType: Hashable>: View {
_selection = selection _selection = selection
} }
var body: some View { var body: some View {
HStack(alignment: .top) { HStack(alignment: .top) {
ForEach(items) { item in ForEach(items) { item in
VStack(alignment: .leading, spacing: 5) { VStack(alignment: .leading, spacing: 5) {
item.thumbnail item.thumbnail
.frame(width: 250, height: 200) .frame(height: 200)
.clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
.overlay(RoundedRectangle(cornerRadius: 10) .overlay(RoundedRectangle(cornerRadius: 10)
.stroke(lineWidth: item.value == selection ? 5 : 0)) .stroke(lineWidth: item.value == selection ? 15 : 0))
.clipShape(RoundedRectangle(cornerRadius: 10, style: .continuous))
.foregroundColor(.accentColor) .foregroundColor(.accentColor)
Text(item.name) Text(item.name)
.bold() .bold()
Text(item.description).frame(width: 250) Text(item.description)
.fixedSize(horizontal: false, vertical: true)
} }
.frame(width: 250)
.onTapGesture { .onTapGesture {
withAnimation(.spring()) { withAnimation(.spring()) {
selection = item.value selection = item.value
} }
} }
} }
.padding(5)
} }
} }