forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGeneralView.swift
More file actions
43 lines (38 loc) · 1.19 KB
/
GeneralView.swift
File metadata and controls
43 lines (38 loc) · 1.19 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import ComposableArchitecture
import GitHubCopilotViewModel
import SwiftUI
struct GeneralView: View {
let store: StoreOf<General>
@StateObject private var viewModel = GitHubCopilotViewModel.shared
var body: some View {
ScrollView {
VStack(alignment: .leading, spacing: 0) {
generalView.padding(20)
Divider()
rightsView.padding(20)
}
.frame(maxWidth: .infinity)
}
.task {
if isPreview { return }
viewModel.checkStatus()
await store.send(.appear).finish()
}
}
private var generalView: some View {
VStack(alignment: .leading, spacing: 30) {
AppInfoView(viewModel: viewModel, store: store)
GeneralSettingsView(store: store)
CopilotConnectionView(viewModel: viewModel, store: store)
}
}
private var rightsView: some View {
Text("GitHub. All rights reserved.")
.font(.caption2)
.foregroundColor(.secondary.opacity(0.5))
}
}
#Preview {
GeneralView(store: .init(initialState: .init(), reducer: { General() }))
.frame(width: 800, height: 600)
}