Skip to content

Commit

Permalink
Fix card image corners, submit to search
Browse files Browse the repository at this point in the history
  • Loading branch information
JacobHearst committed Aug 16, 2022
1 parent f9ad505 commit 9312410
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
2 changes: 1 addition & 1 deletion MTGWizard/Components/CardImage.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct CardImage: View {
image
.resizable()
.scaledToFit()
.cornerRadius(18)
.cornerRadius(10)
.rotationEffect(cardRotationAngle)
.contextMenu {
Button(action: { copyImage(url: url) }) {
Expand Down
1 change: 1 addition & 0 deletions MTGWizard/Components/FullScreenImageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ struct FullScreenImageView: View {
ZStack(alignment: .topTrailing) {
ZoomableScrollView {
CardImage(card: card, imageTypes: [.normal, .png], viewingSecondFace: viewingSecondFace)
.cornerRadius(20)
}

Button(action: { dismiss() }) {
Expand Down
8 changes: 7 additions & 1 deletion MTGWizard/Components/SearchView/SearchView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct SearchView: View {
var body: some View {
VStack {
HStack {
TextField("mana=4gg o:trample pow:6 tou:6", text: $viewModel.searchText)
TextField("mana=4gg o:trample pow:6 tou:6", text: $viewModel.searchText, onCommit: handleSubmit)
.textFieldStyle(RoundedBorderTextFieldStyle())
.disableAutocorrection(true)
.modifier(ClearButton(text: $viewModel.searchText))
Expand Down Expand Up @@ -45,4 +45,10 @@ struct SearchView: View {
sortDirection: $viewModel.sortDirection)
}
}

func handleSubmit() {
Task {
await viewModel.search()
}
}
}

0 comments on commit 9312410

Please sign in to comment.