forked from github/CopilotForXcode
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathToastPanel.swift
More file actions
36 lines (32 loc) · 814 Bytes
/
ToastPanel.swift
File metadata and controls
36 lines (32 loc) · 814 Bytes
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
import ComposableArchitecture
import Preferences
import SwiftUI
import Toast
@Reducer
public struct ToastPanel {
@ObservableState
public struct State: Equatable {
var toast: Toast.State = .init()
var colorScheme: ColorScheme = .light
var alignTopToAnchor = false
}
public enum Action: Equatable {
case start
case toast(Toast.Action)
}
public var body: some ReducerOf<Self> {
Scope(state: \.toast, action: \.toast) {
Toast()
}
Reduce { state, action in
switch action {
case .start:
return .run { send in
await send(.toast(.start))
}
case .toast:
return .none
}
}
}
}