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

@@ -0,0 +1,30 @@
//
// DamusBackground.swift
// damus
//
// Created by William Casarin on 2023-07-12.
//
import Foundation
import SwiftUI
struct DamusBackground: View {
let maxHeight: CGFloat
init(maxHeight: CGFloat = 250.0) {
self.maxHeight = maxHeight
}
var body: some View {
Image("login-header")
.resizable()
.frame(maxWidth: .infinity, maxHeight: maxHeight, alignment: .center)
.ignoresSafeArea()
}
}
struct DamusBackground_Previews: PreviewProvider {
static var previews: some View {
DamusBackground()
}
}