-
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.
fix: account error handling and refactoring (#14)
- Loading branch information
Showing
57 changed files
with
594 additions
and
419 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
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,40 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import SwiftUI | ||
|
||
struct VOFormButtonLabel: View { | ||
private let text: String | ||
private let isLoading: Bool | ||
|
||
init(_ text: String, isLoading: Bool = false) { | ||
self.text = text | ||
self.isLoading = isLoading | ||
} | ||
|
||
var body: some View { | ||
HStack { | ||
Text(text) | ||
if isLoading { | ||
Spacer() | ||
ProgressView() | ||
} | ||
} | ||
} | ||
} | ||
|
||
#Preview { | ||
Form { | ||
Button {} label: { | ||
VOFormButtonLabel("Lorem Ipsum", isLoading: true) | ||
} | ||
.disabled(true) | ||
} | ||
} |
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
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,16 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import Foundation | ||
|
||
protocol ErrorPresentable { | ||
var errorIsPresented: Bool { get set } | ||
var errorMessage: String? { get set } | ||
} |
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,15 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import Foundation | ||
|
||
protocol FormValidatable { | ||
func isValid() -> Bool | ||
} |
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,16 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import Foundation | ||
|
||
protocol LoadStateProvider { | ||
var isLoading: Bool { get } | ||
var error: String? { get } | ||
} |
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,16 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import Foundation | ||
|
||
protocol TimerLifecycle { | ||
func startTimers() | ||
func stopTimers() | ||
} |
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,16 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import Foundation | ||
import VoltaserveCore | ||
|
||
protocol TokenDistributing { | ||
func assignTokenToStores(_ token: VOToken.Value) | ||
} |
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,16 @@ | ||
// Copyright (c) 2024 Anass Bouassaba. | ||
// | ||
// Use of this software is governed by the Business Source License | ||
// included in the file LICENSE in the root of this repository. | ||
// | ||
// As of the Change Date specified in that file, in accordance with | ||
// the Business Source License, use of this software will be governed | ||
// by the GNU Affero General Public License v3.0 only, included in the file | ||
// AGPL-3.0-only in the root of this repository. | ||
|
||
import Foundation | ||
|
||
protocol ViewDataProvider: LoadStateProvider { | ||
func onAppearOrChange() | ||
func fetchData() | ||
} |
Oops, something went wrong.