Skip to content
This repository has been archived by the owner on Dec 24, 2023. It is now read-only.

Commit

Permalink
Use switch instead if if else statements
Browse files Browse the repository at this point in the history
  • Loading branch information
Harry-KNIGHT committed Apr 23, 2023
1 parent 886ae0a commit 50199bd
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
<key>StellarNotificationServiceExtension.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>3</integer>
<integer>4</integer>
</dict>
<key>StellarStickers.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>4</integer>
<integer>3</integer>
</dict>
<key>StellarTests.xcscheme_^#shared#^_</key>
<dict>
Expand Down
1 change: 0 additions & 1 deletion Stellar/View/Components/VideoPlaceHolderCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ struct VideoPlaceHolderCell: View {
ZStack(alignment: .bottomLeading) {
ZStack {
RoundedRectangle(cornerRadius: 0)

.foregroundStyle(linearGradient)
Image(systemName: "play.fill")
.foregroundStyle(.white)
Expand Down
6 changes: 4 additions & 2 deletions Stellar/View/Screens/FavoritesArticlesView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,11 @@ struct FavoritesArticlesView: View {
var body: some View {
NavigationView {
VStack {
if favoriteVM.favoriteArticles.isEmpty {
switch favoriteVM.favoriteArticles.isEmpty {
case true:
EmptyView()
} else {
default:

FavoritesListView()
}
}
Expand Down
5 changes: 3 additions & 2 deletions Stellar/View/Screens/MainScreen.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,10 @@ struct MainScreen: View {
var body: some View {
NavigationView {
VStack {
if articleVm.articles.isEmpty {
switch articleVm.articles.isEmpty {
case true:
LoadingView()
} else {
default:
ArticlesGridView(showFavoritesSheet: $showFavoritesSheet, showBirthdayPicker: $showBirthdayPicker)
}
}
Expand Down

0 comments on commit 50199bd

Please sign in to comment.