Impressia/VernissageWidget/QRCodeWidget/QRCodeWidgetEntryView.swift

24 lines
615 B
Swift
Raw Normal View History

2023-03-11 18:30:33 +01:00
//
// https://mczachurski.dev
// Copyright © 2023 Marcin Czachurski and the repository contributors.
2023-03-28 10:35:38 +02:00
// Licensed under the Apache License 2.0.
2023-03-11 18:30:33 +01:00
//
2023-03-11 18:30:33 +01:00
import WidgetKit
import SwiftUI
2023-05-01 07:50:24 +02:00
struct QRCodeWidgetEntryView: View {
2023-03-11 18:30:33 +01:00
@Environment(\.widgetFamily) var family: WidgetFamily
2023-05-01 07:50:24 +02:00
var entry: QRCodeProvider.Entry
2023-03-11 18:30:33 +01:00
var body: some View {
switch family {
2023-05-01 07:50:24 +02:00
case .systemSmall: QRCodeSmallWidgetView(entry: entry)
case .systemMedium: QRCodeMediumWidgetView(entry: entry)
case .systemLarge: QRCodeLargeWidgetView(entry: entry)
2023-03-11 18:30:33 +01:00
default: Text("Not supported")
}
}
}