ui: add DamusBackground helper

We will be using this in more places
This commit is contained in:
William Casarin
2023-07-12 18:19:13 -07:00
parent 201e9a427f
commit 7046fe0d4f
4 changed files with 36 additions and 14 deletions

View File

@@ -106,13 +106,7 @@ struct LoginView: View {
}
.padding()
}
.background(
Image("login-header")
.resizable()
.frame(maxWidth: .infinity, maxHeight: 350, alignment: .center)
.ignoresSafeArea(),
alignment: .top
)
.background(DamusBackground(maxHeight: 350), alignment: .top)
.onAppear {
credential_handler.check_credentials()
}

View File

@@ -61,13 +61,7 @@ struct SetupView: View {
.padding()
}
}
.background(
Image("login-header")
.resizable()
.frame(maxWidth: .infinity, maxHeight: 300, alignment: .center)
.ignoresSafeArea(),
alignment: .top
)
.background(DamusBackground(maxHeight: 300), alignment: .top)
.navigationDestination(for: Route.self) { route in
route.view(navigationCordinator: navigationCoordinator, damusState: DamusState.empty)
}