generated from DevYeom/swift-app-package
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
98 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// BadaBook | ||
// Apache License, Version 2.0 | ||
// | ||
// Copyright (c) 2024 Seungyeop Yeom ( https://github.com/OceanPositive ). | ||
// | ||
|
||
import BadaCore | ||
|
||
struct ProfileReducer: Reducer { | ||
enum Action: Sendable { | ||
case load | ||
case save | ||
} | ||
|
||
struct State: Sendable, Equatable { | ||
} | ||
|
||
func reduce(state: inout State, action: Action) -> AnyEffect<Action> { | ||
switch action { | ||
case .load: | ||
return .none | ||
case .save: | ||
return .none | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
// | ||
// BadaBook | ||
// Apache License, Version 2.0 | ||
// | ||
// Copyright (c) 2024 Seungyeop Yeom ( https://github.com/OceanPositive ). | ||
// | ||
|
||
import BadaCore | ||
import BadaUI | ||
|
||
struct ProfileView: View { | ||
@StateObject private var store = ViewStore( | ||
reducer: ProfileReducer(), | ||
state: ProfileReducer.State() | ||
) | ||
|
||
var body: some View { | ||
Form { | ||
|
||
} | ||
#if os(macOS) | ||
.padding() | ||
#endif | ||
.navigationTitle("Profile") | ||
#if os(iOS) | ||
.navigationBarTitleDisplayMode(.inline) | ||
#endif | ||
.toolbar { | ||
ToolbarItem(placement: .confirmationAction) { | ||
saveButton | ||
} | ||
} | ||
.onAppear(perform: onAppear) | ||
} | ||
|
||
private var saveButton: some View { | ||
Button(action: tapSaveButton) { | ||
Text("Save") | ||
} | ||
} | ||
|
||
private func onAppear() { | ||
store.send(.load) | ||
} | ||
|
||
private func tapSaveButton() { | ||
store.send(.save) | ||
} | ||
} | ||
|
||
#Preview { | ||
ProfileView() | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters