Skip to content

Commit

Permalink
add animation
Browse files Browse the repository at this point in the history
  • Loading branch information
LucasJorgeHubert committed May 17, 2023
1 parent b70be9e commit 0f078ec
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
4 changes: 3 additions & 1 deletion MarvelUI/Core/Home/View/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ struct HomeView: View {
LocationSearchActivationView()
.padding(.vertical, 72)
.onTapGesture {
showLocationSearchView.toggle()
withAnimation(.spring()) {
showLocationSearchView.toggle()
}
}
}

Expand Down
10 changes: 8 additions & 2 deletions MarvelUI/Core/Home/View/MapViewActionButton.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,15 @@ struct MapViewActionButton: View {

var body: some View {
Button {
showLocationSearchView.toggle()
withAnimation(.spring()) {
showLocationSearchView.toggle()
}
} label: {
Image(systemName: "line.3.horizontal")
Image(
systemName: showLocationSearchView
? "arrow.left"
: "line.3.horizontal"
)
.font(.title2)
.foregroundColor(.black)
.padding()
Expand Down

0 comments on commit 0f078ec

Please sign in to comment.