radio view fix
This commit is contained in:
parent
c3e387f185
commit
b4e64b545f
1 changed files with 7 additions and 7 deletions
|
|
@ -219,38 +219,38 @@ struct RadioView: View {
|
|||
}
|
||||
|
||||
// MARK: - Station Row
|
||||
|
||||
|
||||
@ViewBuilder
|
||||
private func stationRow(_ station: RadioStation) -> some View {
|
||||
let canPlay = libraryCache.isServerAvailable
|
||||
Button(action: {
|
||||
if canPlay { playStation(station) }
|
||||
if libraryCache.isServerAvailable { playStation(station) }
|
||||
}) {
|
||||
HStack(spacing: 14) {
|
||||
RadioStationCover(
|
||||
stationId: station.id,
|
||||
isPlaying: playingStationId == station.id
|
||||
)
|
||||
.opacity(canPlay ? 1.0 : 0.4)
|
||||
.opacity(libraryCache.isServerAvailable ? 1.0 : 0.4)
|
||||
|
||||
VStack(alignment: .leading, spacing: 3) {
|
||||
Text(station.name)
|
||||
.font(.system(size: 16, weight: .medium))
|
||||
.foregroundColor(
|
||||
!canPlay ? .gray.opacity(0.4) :
|
||||
!libraryCache.isServerAvailable ? .gray.opacity(0.4) :
|
||||
playingStationId == station.id ? accentPink : .white
|
||||
)
|
||||
|
||||
if let home = station.homePageUrl, !home.isEmpty {
|
||||
Text(home)
|
||||
.font(.system(size: 12))
|
||||
.foregroundColor(canPlay ? .gray : .gray.opacity(0.3))
|
||||
.foregroundColor(libraryCache.isServerAvailable ? .gray : .gray.opacity(0.3))
|
||||
.lineLimit(1)
|
||||
}
|
||||
}
|
||||
|
||||
Spacer()
|
||||
|
||||
if playingStationId == station.id && canPlay {
|
||||
if playingStationId == station.id && libraryCache.isServerAvailable {
|
||||
Image(systemName: "waveform")
|
||||
.font(.system(size: 14))
|
||||
.foregroundColor(accentPink)
|
||||
|
|
|
|||
Loading…
Reference in a new issue