Add animations

This commit is contained in:
Alfonso Grillo 2022-11-03 14:55:33 +01:00
parent 164e1d103d
commit 4a98acda3c
2 changed files with 4 additions and 2 deletions

View file

@ -53,7 +53,7 @@ struct UserOtherSessions: View {
UserOtherSessionsToolbar(isEditModeEnabled: $viewModel.isEditModeEnabled,
filter: $viewModel.filter,
isShowLocationEnabled: .init(get: { viewModel.viewState.showLocationInfo },
set: { _ in viewModel.send(viewAction: .showLocationInfo) }),
set: { _ in withAnimation { viewModel.send(viewAction: .showLocationInfo) } }),
allItemsSelected: viewModel.viewState.allItemsSelected,
sessionCount: viewModel.viewState.sessionItems.count,
onToggleSelection: { viewModel.send(viewAction: .toggleAllSelection) },

View file

@ -143,7 +143,9 @@ struct UserSessionsOverview: View {
private var otherSessionsMenu: some View {
Menu {
Button {
viewModel.send(viewAction: .showLocationInfo)
withAnimation {
viewModel.send(viewAction: .showLocationInfo)
}
} label: {
Label(showLocationInfo: viewModel.viewState.showLocationInfo)
}