diff --git a/Passepartout/Library/Sources/AppUIMain/Views/Modules/OpenVPNView.swift b/Passepartout/Library/Sources/AppUIMain/Views/Modules/OpenVPNView.swift index d480f3db..11d3d917 100644 --- a/Passepartout/Library/Sources/AppUIMain/Views/Modules/OpenVPNView.swift +++ b/Passepartout/Library/Sources/AppUIMain/Views/Modules/OpenVPNView.swift @@ -84,8 +84,9 @@ struct OpenVPNView: View, ModuleDraftEditing { onCompletion: importConfiguration ) .modifier(PaywallModifier(reason: $paywallReason)) - .withErrorHandler(errorHandler) .navigationDestination(for: Subroute.self, destination: destination) + .themeAnimation(on: providerId.wrappedValue, category: .modules) + .withErrorHandler(errorHandler) } } diff --git a/Passepartout/Library/Sources/AppUITV/Views/Profile/ProfileView.swift b/Passepartout/Library/Sources/AppUITV/Views/Profile/ProfileView.swift index 71489bf1..6bfd9c14 100644 --- a/Passepartout/Library/Sources/AppUITV/Views/Profile/ProfileView.swift +++ b/Passepartout/Library/Sources/AppUITV/Views/Profile/ProfileView.swift @@ -91,7 +91,7 @@ struct ProfileView: View, TunnelInstallationProviding { } .ignoresSafeArea(edges: .horizontal) .background(theme.primaryColor.gradient) - .animation(.default, value: isSwitching) + .themeAnimation(on: isSwitching, category: .profiles) .withErrorHandler(errorHandler) .defaultFocus($focusedField, .switchProfile) .onChange(of: tunnel.status) { _, new in diff --git a/Passepartout/Library/Sources/UILibrary/Theme/UI/Theme+Modifiers.swift b/Passepartout/Library/Sources/UILibrary/Theme/UI/Theme+Modifiers.swift index 51ccff25..c9219c12 100644 --- a/Passepartout/Library/Sources/UILibrary/Theme/UI/Theme+Modifiers.swift +++ b/Passepartout/Library/Sources/UILibrary/Theme/UI/Theme+Modifiers.swift @@ -103,15 +103,6 @@ extension View { #endif } -#if !os(tvOS) - public func themeWindow(width: CGFloat, height: CGFloat) -> some View { - modifier(ThemeWindowModifier(size: .init(width: width, height: height))) - } - - public func themePlainButton(action: @escaping () -> Void) -> some View { - modifier(ThemePlainButtonModifier(action: action)) - } - @ViewBuilder public func themeMultiLine(_ isMultiLine: Bool) -> some View { if isMultiLine { @@ -138,6 +129,15 @@ extension View { modifier(ThemeAnimationModifier(value: value, category: category)) } +#if !os(tvOS) + public func themeWindow(width: CGFloat, height: CGFloat) -> some View { + modifier(ThemeWindowModifier(size: .init(width: width, height: height))) + } + + public func themePlainButton(action: @escaping () -> Void) -> some View { + modifier(ThemePlainButtonModifier(action: action)) + } + public func themeTrailingValue(_ value: CustomStringConvertible?, truncationMode: Text.TruncationMode = .tail) -> some View { modifier(ThemeTrailingValueModifier(value: value, truncationMode: truncationMode)) } @@ -298,16 +298,6 @@ struct ThemeRowWithFooterModifier: ViewModifier { let footer: String? } -#if !os(tvOS) - -struct ThemeWindowModifier: ViewModifier { - let size: CGSize -} - -struct ThemePlainButtonModifier: ViewModifier { - let action: () -> Void -} - struct ThemeEmptyMessageModifier: ViewModifier { @EnvironmentObject @@ -352,6 +342,16 @@ struct ThemeAnimationModifier: ViewModifier where T: Equatable { } } +#if !os(tvOS) + +struct ThemeWindowModifier: ViewModifier { + let size: CGSize +} + +struct ThemePlainButtonModifier: ViewModifier { + let action: () -> Void +} + struct ThemeTrailingValueModifier: ViewModifier { let value: CustomStringConvertible?