adds widget url

This commit is contained in:
Stuart Breckenridge 2020-11-30 15:41:15 +08:00
parent d9c39a6964
commit b664f21cab
No known key found for this signature in database
GPG Key ID: 1F11FD62007DC331
4 changed files with 8 additions and 13 deletions

View File

@ -17,16 +17,8 @@ struct SmartFeedSummaryWidgetView: View {
var entry: Provider.Entry
var body: some View {
switch family {
case .systemSmall:
smallWidget
case .systemMedium:
smallWidget
case .systemLarge:
smallWidget
@unknown default:
smallWidget
}
smallWidget
.widgetURL(WidgetDeepLink.icon.url)
}
@ViewBuilder

View File

@ -18,6 +18,7 @@ struct StarredWidgetView : View {
var body: some View {
if entry.widgetData.starredArticles.count == 0 {
inboxZero
.widgetURL(WidgetDeepLink.starred.url)
}
else {
GeometryReader { metrics in
@ -49,7 +50,7 @@ struct StarredWidgetView : View {
Spacer()
}.padding(.leading, 4)
}.padding()
}
}.widgetURL(WidgetDeepLink.starred.url)
}
}

View File

@ -18,6 +18,7 @@ struct TodayWidgetView : View {
var body: some View {
if entry.widgetData.todayArticles.count == 0 {
inboxZero
.widgetURL(WidgetDeepLink.today.url)
}
else {
GeometryReader { metrics in
@ -50,7 +51,7 @@ struct TodayWidgetView : View {
Spacer()
}.padding(.leading, 4)
}.padding()
}
}.widgetURL(WidgetDeepLink.today.url)
}
}

View File

@ -18,6 +18,7 @@ struct UnreadWidgetView : View {
var body: some View {
if entry.widgetData.currentUnreadCount == 0 {
inboxZero
.widgetURL(WidgetDeepLink.unread.url)
}
else {
GeometryReader { metrics in
@ -49,7 +50,7 @@ struct UnreadWidgetView : View {
Spacer()
}.padding(.leading, 4)
}.padding()
}
}.widgetURL(WidgetDeepLink.unread.url)
}
}