38 lines
847 B
Swift
38 lines
847 B
Swift
//
|
|
// TopOverlayView.swift
|
|
// TheNoiseClock
|
|
//
|
|
// Created by Matt Bruce on 9/7/25.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
/// Component for displaying top overlay with battery and date information
|
|
struct TopOverlayView: View {
|
|
|
|
// MARK: - Properties
|
|
let showBattery: Bool
|
|
let showDate: Bool
|
|
let color: Color
|
|
let opacity: Double
|
|
|
|
// MARK: - Body
|
|
var body: some View {
|
|
HStack {
|
|
if showDate {
|
|
DateOverlayView(color: color, opacity: opacity)
|
|
}
|
|
|
|
Spacer()
|
|
|
|
if showBattery {
|
|
BatteryOverlayView(color: color, opacity: opacity)
|
|
}
|
|
}
|
|
.padding(.horizontal, UIConstants.Spacing.medium)
|
|
.padding(.vertical, UIConstants.Spacing.small)
|
|
.cardStyle()
|
|
.transition(.opacity)
|
|
}
|
|
}
|