|
|
@@ -48,35 +48,31 @@ struct DesktopWidgetView: View {
|
|
|
|
|
|
@ViewBuilder
|
|
|
private var contentBody: some View {
|
|
|
- if !isSignedIn {
|
|
|
- loggedOutContent
|
|
|
- } else {
|
|
|
- switch variant.size {
|
|
|
- case .small:
|
|
|
- VStack(alignment: .leading, spacing: 10) {
|
|
|
- Text("Quick actions")
|
|
|
- .font(.system(size: 11.5, weight: .semibold))
|
|
|
- .foregroundStyle(.white.opacity(0.78))
|
|
|
- compactActionButton(title: "Open Meet", icon: "video.fill", destination: .openMeetWeb)
|
|
|
- HStack(spacing: 8) {
|
|
|
- compactActionButton(title: "Schedule", icon: "clock.badge.checkmark", destination: .schedule)
|
|
|
- compactActionButton(title: "Settings", icon: "gearshape.fill", destination: .settings)
|
|
|
- }
|
|
|
+ switch variant.size {
|
|
|
+ case .small:
|
|
|
+ VStack(alignment: .leading, spacing: 10) {
|
|
|
+ Text("Quick actions")
|
|
|
+ .font(.system(size: 11.5, weight: .semibold))
|
|
|
+ .foregroundStyle(.white.opacity(0.78))
|
|
|
+ compactActionButton(title: "Open Meet", icon: "video.fill", destination: .openMeetWeb)
|
|
|
+ HStack(spacing: 8) {
|
|
|
+ compactActionButton(title: "Schedule", icon: "clock.badge.checkmark", destination: .schedule)
|
|
|
+ compactActionButton(title: "Settings", icon: "gearshape.fill", destination: .settings)
|
|
|
}
|
|
|
- case .medium:
|
|
|
- meetingBlock(maxRows: 2)
|
|
|
- LazyVGrid(columns: Array(repeating: GridItem(.flexible(minimum: 0), spacing: 8), count: 2), spacing: 8) {
|
|
|
- ForEach(variant.quickActions.prefix(4)) { action in
|
|
|
- actionTile(action)
|
|
|
- }
|
|
|
+ }
|
|
|
+ case .medium:
|
|
|
+ meetingBlock(maxRows: 2)
|
|
|
+ LazyVGrid(columns: Array(repeating: GridItem(.flexible(minimum: 0), spacing: 8), count: 2), spacing: 8) {
|
|
|
+ ForEach(variant.quickActions.prefix(4)) { action in
|
|
|
+ actionTile(action)
|
|
|
}
|
|
|
- case .large:
|
|
|
- meetingBlock(maxRows: 3)
|
|
|
- Divider().overlay(Color.white.opacity(0.18))
|
|
|
- LazyVGrid(columns: Array(repeating: GridItem(.flexible(minimum: 0), spacing: 8), count: 2), spacing: 8) {
|
|
|
- ForEach(variant.quickActions.prefix(6)) { action in
|
|
|
- actionTile(action)
|
|
|
- }
|
|
|
+ }
|
|
|
+ case .large:
|
|
|
+ meetingBlock(maxRows: 3)
|
|
|
+ Divider().overlay(Color.white.opacity(0.18))
|
|
|
+ LazyVGrid(columns: Array(repeating: GridItem(.flexible(minimum: 0), spacing: 8), count: 2), spacing: 8) {
|
|
|
+ ForEach(variant.quickActions.prefix(6)) { action in
|
|
|
+ actionTile(action)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
@@ -106,7 +102,9 @@ struct DesktopWidgetView: View {
|
|
|
Text("Upcoming meetings")
|
|
|
.font(.system(size: 11.5, weight: .semibold))
|
|
|
.foregroundStyle(.white.opacity(0.80))
|
|
|
- if topMeetings.isEmpty {
|
|
|
+ if !isSignedIn {
|
|
|
+ signInCTA
|
|
|
+ } else if topMeetings.isEmpty {
|
|
|
Text("No upcoming meetings")
|
|
|
.font(.system(size: 12, weight: .medium))
|
|
|
.foregroundStyle(.white.opacity(0.82))
|
|
|
@@ -120,13 +118,13 @@ struct DesktopWidgetView: View {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- @ViewBuilder
|
|
|
- private var loggedOutContent: some View {
|
|
|
+ private var signInCTA: some View {
|
|
|
VStack(alignment: .leading, spacing: 10) {
|
|
|
- Text("Connect Google to use widget actions.")
|
|
|
+ Text("Sign in to see upcoming meetings")
|
|
|
.font(.system(size: 12, weight: .medium))
|
|
|
.foregroundStyle(.white.opacity(0.86))
|
|
|
- Button(action: { open(action: WidgetQuickAction(id: "login", title: "Login", systemImage: "person.crop.circle.badge.checkmark", destination: .signIn)) }) {
|
|
|
+
|
|
|
+ Button(action: { WidgetAppNavigator.open(target: .signIn) }) {
|
|
|
HStack(spacing: 8) {
|
|
|
Image(systemName: "person.crop.circle.badge.checkmark")
|
|
|
.font(.system(size: 12, weight: .semibold))
|