chore(widgets): rename widget
This commit is contained in:
		| @@ -1,6 +1,6 @@ | |||||||
| // | // | ||||||
| //  StepMapWidgets.swift | //  StepsWidget.swift | ||||||
| //  StepMapWidgets | //  StepsWidget | ||||||
| // | // | ||||||
| //  Created by Oliver Hnát on 04.12.2024. | //  Created by Oliver Hnát on 04.12.2024. | ||||||
| // | // | ||||||
| @@ -8,7 +8,7 @@ | |||||||
| import WidgetKit | import WidgetKit | ||||||
| import SwiftUI | import SwiftUI | ||||||
|  |  | ||||||
| struct Provider: TimelineProvider { | struct StepsWidgetProvider: TimelineProvider { | ||||||
|     func placeholder(in context: Context) -> SimpleEntry { |     func placeholder(in context: Context) -> SimpleEntry { | ||||||
|         SimpleEntry(date: Date(), emoji: "😀") |         SimpleEntry(date: Date(), emoji: "😀") | ||||||
|     } |     } | ||||||
| @@ -43,8 +43,8 @@ struct SimpleEntry: TimelineEntry { | |||||||
|     let emoji: String |     let emoji: String | ||||||
| } | } | ||||||
|  |  | ||||||
| struct StepMapWidgetsEntryView : View { | struct StepsWidgetEntryView : View { | ||||||
|     var entry: Provider.Entry |     var entry: StepsWidgetProvider.Entry | ||||||
|  |  | ||||||
|     var body: some View { |     var body: some View { | ||||||
|         VStack { |         VStack { | ||||||
| @@ -57,27 +57,27 @@ struct StepMapWidgetsEntryView : View { | |||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| struct StepMapWidgets: Widget { | struct StepsWidget: Widget { | ||||||
|     let kind: String = "StepMapWidgets" |     let kind: String = "oliverhnat.StepMap.Steps" | ||||||
|  |  | ||||||
|     var body: some WidgetConfiguration { |     var body: some WidgetConfiguration { | ||||||
|         StaticConfiguration(kind: kind, provider: Provider()) { entry in |         StaticConfiguration(kind: kind, provider: StepsWidgetProvider()) { entry in | ||||||
|             if #available(iOS 17.0, *) { |             if #available(iOS 17.0, *) { | ||||||
|                 StepMapWidgetsEntryView(entry: entry) |                 StepsWidgetEntryView(entry: entry) | ||||||
|                     .containerBackground(.fill.tertiary, for: .widget) |                     .containerBackground(.fill.tertiary, for: .widget) | ||||||
|             } else { |             } else { | ||||||
|                 StepMapWidgetsEntryView(entry: entry) |                 StepsWidgetEntryView(entry: entry) | ||||||
|                     .padding() |                     .padding() | ||||||
|                     .background() |                     .background() | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         .configurationDisplayName("My Widget") |         .configurationDisplayName("Steps Widget") | ||||||
|         .description("This is an example widget.") |         .description("Widget that shows you your current step count.") | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
| #Preview(as: .systemSmall) { | #Preview(as: .systemSmall) { | ||||||
|     StepMapWidgets() |     StepsWidget() | ||||||
| } timeline: { | } timeline: { | ||||||
|     SimpleEntry(date: .now, emoji: "😀") |     SimpleEntry(date: .now, emoji: "😀") | ||||||
|     SimpleEntry(date: .now, emoji: "🤩") |     SimpleEntry(date: .now, emoji: "🤩") | ||||||
|   | |||||||
| @@ -1,6 +1,6 @@ | |||||||
| // | // | ||||||
| //  StepMapWidgetsBundle.swift | //  StepsWidgetBundle.swift | ||||||
| //  StepMapWidgets | //  StepsWidget | ||||||
| // | // | ||||||
| //  Created by Oliver Hnát on 04.12.2024. | //  Created by Oliver Hnát on 04.12.2024. | ||||||
| // | // | ||||||
| @@ -9,8 +9,8 @@ import WidgetKit | |||||||
| import SwiftUI | import SwiftUI | ||||||
|  |  | ||||||
| @main | @main | ||||||
| struct StepMapWidgetsBundle: WidgetBundle { | struct StepsWidgetBundle: WidgetBundle { | ||||||
|     var body: some Widget { |     var body: some Widget { | ||||||
|         StepMapWidgets() |         StepsWidget() | ||||||
|     } |     } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user