Skip to content

Commit

Permalink
Merge branch 'develop' into imgbot
Browse files Browse the repository at this point in the history
  • Loading branch information
takasurazeem authored Sep 23, 2023
2 parents ff40ede + ac6ba9f commit d61a1f8
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 27 deletions.
1 change: 1 addition & 0 deletions QuranMajeed/Quiz/Main/View/SuraListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ struct SuraListView: View {
presentationMode.wrappedValue.dismiss()
}
}
.navigationTitle("Select Sura")
.searchable(text: $searchText)
}
}
Expand Down
17 changes: 4 additions & 13 deletions QuranMajeed/Quiz/Main/View/VerseListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,29 +34,20 @@ struct VerseListView: View {
}
}
.environment(\.editMode, $defaultEditMode)
.onDisappear {
defaultEditMode = .inactive
}
.onChange(of: selection) { newValue in
if newValue.count > 0 {
selectedVerses = Array(selection).sorted()
}
}
.onChange(of: editMode?.wrappedValue) { newValue in
if newValue == EditMode.inactive {
dismiss()
} else {
// Leaving edit mode (e.g. 'Done' tapped)
}
}
.searchable(text: $searchText)
.navigationTitle("Ayah Selection")
.toolbar { EditButton() }
}
}

#Preview {
ContentPreview()
struct VerseListView_Previews: PreviewProvider {
static var previews: some View {
ContentPreview()
}
}

fileprivate struct ContentPreview: View {
Expand Down
14 changes: 0 additions & 14 deletions QuranMajeed/Quiz/Main/ViewModel/QuizViewModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -70,20 +70,6 @@ extension QuizView {
suras = reading.quran.suras
}
}

func addSelectedVerseToQuiz() {
// if selectedVerses.contains(where: { verse in
// (verse.surahId == selectedSurah.id && verse.ayahId == selectedVerse.id) || verse.text == selectedVerse.text
// }) == false {
// let verse = QuizVerse(
// surahId: selectedSurah.id,
// ayahId: selectedVerse.id,
// text: selectedVerse.text
// )
// print(verse)
// selectedVerses.append(verse)
// }
}

func delete(at offsets: IndexSet) {
selectedVerses.remove(atOffsets: offsets)
Expand Down

0 comments on commit d61a1f8

Please sign in to comment.