Update EpisodesRowView.swift
This commit is contained in:
parent
6771d3d2c9
commit
61873c7017
|
@ -21,26 +21,33 @@ struct EpisodesRowView<RowManager>: View where RowManager: EpisodesRowManager {
|
||||||
VStack(alignment: .leading, spacing: 0) {
|
VStack(alignment: .leading, spacing: 0) {
|
||||||
|
|
||||||
HStack {
|
HStack {
|
||||||
Menu {
|
|
||||||
ForEach(Array(viewModel.seasonsEpisodes.keys).sorted(by: { $0.name ?? "" < $1.name ?? "" }), id: \.self) { season in
|
if onlyCurrentSeason {
|
||||||
Button {
|
if let currentSeason = Array(viewModel.seasonsEpisodes.keys).first(where: { $0.id == viewModel.item.id }) {
|
||||||
viewModel.selectedSeason = season
|
Text(currentSeason.name ?? L10n.noTitle)
|
||||||
} label: {
|
}
|
||||||
if season.id == viewModel.selectedSeason?.id {
|
} else {
|
||||||
Label(season.name ?? L10n.season, systemImage: "checkmark")
|
Menu {
|
||||||
} else {
|
ForEach(Array(viewModel.seasonsEpisodes.keys).sorted(by: { $0.name ?? "" < $1.name ?? "" }), id: \.self) { season in
|
||||||
Text(season.name ?? L10n.season)
|
Button {
|
||||||
}
|
viewModel.select(season: season)
|
||||||
}
|
} label: {
|
||||||
}
|
if season.id == viewModel.selectedSeason?.id {
|
||||||
} label: {
|
Label(season.name ?? L10n.season, systemImage: "checkmark")
|
||||||
HStack(spacing: 5) {
|
} else {
|
||||||
Text(viewModel.selectedSeason?.name ?? L10n.unknown)
|
Text(season.name ?? L10n.season)
|
||||||
.fontWeight(.semibold)
|
}
|
||||||
.fixedSize()
|
}
|
||||||
Image(systemName: "chevron.down")
|
}
|
||||||
}
|
} label: {
|
||||||
}
|
HStack(spacing: 5) {
|
||||||
|
Text(viewModel.selectedSeason?.name ?? L10n.unknown)
|
||||||
|
.fontWeight(.semibold)
|
||||||
|
.fixedSize()
|
||||||
|
Image(systemName: "chevron.down")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Spacer()
|
Spacer()
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue