Signed-off-by: Matt Bruce <mbrucedogs@gmail.com>
This commit is contained in:
parent
8829a5a912
commit
fdcb594511
@ -8,9 +8,20 @@ import Bedrock
|
||||
struct PhotoPickerWithCropper: View {
|
||||
@Environment(\.dismiss) private var dismiss
|
||||
|
||||
let aspectRatio: CropAspectRatio
|
||||
let onSave: (Data) -> Void
|
||||
let onCancel: () -> Void
|
||||
|
||||
init(
|
||||
aspectRatio: CropAspectRatio = .square,
|
||||
onSave: @escaping (Data) -> Void,
|
||||
onCancel: @escaping () -> Void
|
||||
) {
|
||||
self.aspectRatio = aspectRatio
|
||||
self.onSave = onSave
|
||||
self.onCancel = onCancel
|
||||
}
|
||||
|
||||
@State private var selectedItem: PhotosPickerItem?
|
||||
@State private var imageData: Data?
|
||||
@State private var showingCropper = false
|
||||
@ -41,6 +52,7 @@ struct PhotoPickerWithCropper: View {
|
||||
if showingCropper, let imageData {
|
||||
PhotoCropperSheet(
|
||||
imageData: imageData,
|
||||
aspectRatio: aspectRatio,
|
||||
shouldDismissOnComplete: false
|
||||
) { croppedData in
|
||||
if let croppedData {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user