mirror of
https://github.com/bitwarden/ios.git
synced 2025-12-11 13:54:06 -06:00
24 lines
570 B
Swift
24 lines
570 B
Swift
import SwiftUI
|
|
|
|
// MARK: - ScrollViewModifier
|
|
|
|
/// A modifier that adds padded content to a `ScrollView`.
|
|
///
|
|
struct ScrollViewModifier: ViewModifier {
|
|
// MARK: Properties
|
|
|
|
/// Whether or not to add the vertical padding.
|
|
var addVerticalPadding = true
|
|
|
|
// MARK: View
|
|
|
|
func body(content: Content) -> some View {
|
|
ScrollView {
|
|
content
|
|
.padding(.horizontal, 16)
|
|
.padding([.top, .bottom], addVerticalPadding ? 16 : 0)
|
|
}
|
|
.background(Color(asset: Asset.Colors.backgroundSecondary))
|
|
}
|
|
}
|