-
Notifications
You must be signed in to change notification settings - Fork 57
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/HCPSDKFIORIUIKIT-2700
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 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
45 changes: 45 additions & 0 deletions
45
.../Examples/Examples/FioriSwiftUICore/CheckoutIndicator/CheckoutIndicatorModalExample.swift
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,45 @@ | ||
import FioriSwiftUICore | ||
import SwiftUI | ||
|
||
struct CheckoutIndicatorModalExample: View { | ||
@State private var showModal = false | ||
|
||
var body: some View { | ||
Button("Show Modal") { | ||
self.showModal.toggle() | ||
} | ||
.sheet(isPresented: self.$showModal) { | ||
ModalView() | ||
} | ||
} | ||
} | ||
|
||
struct ModalView: View { | ||
@Environment(\.dismiss) var dismiss | ||
@State var displayState: DisplayState = .inProgress | ||
var size = CGSize(width: 130, height: 130) | ||
|
||
var body: some View { | ||
VStack { | ||
CheckoutIndicator(displayState: self.$displayState) | ||
.frame(width: self.size.width, height: self.size.height) | ||
|
||
Picker("Display State", selection: self.$displayState) { | ||
Text(String("inProgress")) | ||
.tag(DisplayState.inProgress) | ||
Text(String("completed")) | ||
.tag(DisplayState.completed) | ||
Text(String("failed")) | ||
.tag(DisplayState.failed) | ||
} | ||
.pickerStyle(.segmented) | ||
.padding(.top, 20) | ||
.frame(maxWidth: 300) | ||
|
||
Button("Dismiss Modal") { | ||
self.dismiss() | ||
} | ||
.padding(.top, 20) | ||
} | ||
} | ||
} |
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