refactor: rename ImagePicker -> MediaPicker
The responsibility of MediaPicker is to 'pick' all sorts of media, not just images. Lightning-address: kernelkind@getalby.com Signed-off-by: kernelkind <kernelkind@gmail.com> Signed-off-by: William Casarin <jb55@jb55.com>
This commit is contained in:
committed by
William Casarin
parent
4c0c8b6678
commit
2be83560bc
@@ -640,7 +640,7 @@
|
|||||||
F71694F22A67314D001F4053 /* SuggestedUserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71694F12A67314D001F4053 /* SuggestedUserView.swift */; };
|
F71694F22A67314D001F4053 /* SuggestedUserView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71694F12A67314D001F4053 /* SuggestedUserView.swift */; };
|
||||||
F71694F42A6732B7001F4053 /* GradientFollowButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71694F32A6732B7001F4053 /* GradientFollowButton.swift */; };
|
F71694F42A6732B7001F4053 /* GradientFollowButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71694F32A6732B7001F4053 /* GradientFollowButton.swift */; };
|
||||||
F71694F82A6983AF001F4053 /* GrayGradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71694F72A6983AF001F4053 /* GrayGradient.swift */; };
|
F71694F82A6983AF001F4053 /* GrayGradient.swift in Sources */ = {isa = PBXBuildFile; fileRef = F71694F72A6983AF001F4053 /* GrayGradient.swift */; };
|
||||||
F757933A29D7AECD007DEAC1 /* ImagePicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F757933929D7AECD007DEAC1 /* ImagePicker.swift */; };
|
F757933A29D7AECD007DEAC1 /* MediaPicker.swift in Sources */ = {isa = PBXBuildFile; fileRef = F757933929D7AECD007DEAC1 /* MediaPicker.swift */; };
|
||||||
F75BA12D29A1855400E10810 /* BookmarksManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75BA12C29A1855400E10810 /* BookmarksManager.swift */; };
|
F75BA12D29A1855400E10810 /* BookmarksManager.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75BA12C29A1855400E10810 /* BookmarksManager.swift */; };
|
||||||
F75BA12F29A18EF500E10810 /* BookmarksView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75BA12E29A18EF500E10810 /* BookmarksView.swift */; };
|
F75BA12F29A18EF500E10810 /* BookmarksView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F75BA12E29A18EF500E10810 /* BookmarksView.swift */; };
|
||||||
F7908E92298B0F0700AB113A /* RelayDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7908E91298B0F0700AB113A /* RelayDetailView.swift */; };
|
F7908E92298B0F0700AB113A /* RelayDetailView.swift in Sources */ = {isa = PBXBuildFile; fileRef = F7908E91298B0F0700AB113A /* RelayDetailView.swift */; };
|
||||||
@@ -1419,7 +1419,7 @@
|
|||||||
F71694F12A67314D001F4053 /* SuggestedUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestedUserView.swift; sourceTree = "<group>"; };
|
F71694F12A67314D001F4053 /* SuggestedUserView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SuggestedUserView.swift; sourceTree = "<group>"; };
|
||||||
F71694F32A6732B7001F4053 /* GradientFollowButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientFollowButton.swift; sourceTree = "<group>"; };
|
F71694F32A6732B7001F4053 /* GradientFollowButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GradientFollowButton.swift; sourceTree = "<group>"; };
|
||||||
F71694F72A6983AF001F4053 /* GrayGradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrayGradient.swift; sourceTree = "<group>"; };
|
F71694F72A6983AF001F4053 /* GrayGradient.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = GrayGradient.swift; sourceTree = "<group>"; };
|
||||||
F757933929D7AECD007DEAC1 /* ImagePicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ImagePicker.swift; sourceTree = "<group>"; };
|
F757933929D7AECD007DEAC1 /* MediaPicker.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MediaPicker.swift; sourceTree = "<group>"; };
|
||||||
F75BA12C29A1855400E10810 /* BookmarksManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksManager.swift; sourceTree = "<group>"; };
|
F75BA12C29A1855400E10810 /* BookmarksManager.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksManager.swift; sourceTree = "<group>"; };
|
||||||
F75BA12E29A18EF500E10810 /* BookmarksView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksView.swift; sourceTree = "<group>"; };
|
F75BA12E29A18EF500E10810 /* BookmarksView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BookmarksView.swift; sourceTree = "<group>"; };
|
||||||
F7908E91298B0F0700AB113A /* RelayDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RelayDetailView.swift; sourceTree = "<group>"; };
|
F7908E91298B0F0700AB113A /* RelayDetailView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RelayDetailView.swift; sourceTree = "<group>"; };
|
||||||
@@ -1991,7 +1991,7 @@
|
|||||||
4C75EFAC28049CFB0006080F /* PostButton.swift */,
|
4C75EFAC28049CFB0006080F /* PostButton.swift */,
|
||||||
4C75EFA327FA577B0006080F /* PostView.swift */,
|
4C75EFA327FA577B0006080F /* PostView.swift */,
|
||||||
9CA876E129A00CE90003B9A3 /* AttachMediaUtility.swift */,
|
9CA876E129A00CE90003B9A3 /* AttachMediaUtility.swift */,
|
||||||
F757933929D7AECD007DEAC1 /* ImagePicker.swift */,
|
F757933929D7AECD007DEAC1 /* MediaPicker.swift */,
|
||||||
9C83F89229A937B900136C08 /* TextViewWrapper.swift */,
|
9C83F89229A937B900136C08 /* TextViewWrapper.swift */,
|
||||||
4C3AC7A42836987600E1F516 /* MainTabView.swift */,
|
4C3AC7A42836987600E1F516 /* MainTabView.swift */,
|
||||||
4C363A8B28236B92006E126D /* PubkeyView.swift */,
|
4C363A8B28236B92006E126D /* PubkeyView.swift */,
|
||||||
@@ -3028,7 +3028,7 @@
|
|||||||
4C190F202A535FC200027FD5 /* CustomizeZapModel.swift in Sources */,
|
4C190F202A535FC200027FD5 /* CustomizeZapModel.swift in Sources */,
|
||||||
D798D22C2B086C7400234419 /* NostrEvent+.swift in Sources */,
|
D798D22C2B086C7400234419 /* NostrEvent+.swift in Sources */,
|
||||||
4C75EFB728049D990006080F /* RelayPool.swift in Sources */,
|
4C75EFB728049D990006080F /* RelayPool.swift in Sources */,
|
||||||
F757933A29D7AECD007DEAC1 /* ImagePicker.swift in Sources */,
|
F757933A29D7AECD007DEAC1 /* MediaPicker.swift in Sources */,
|
||||||
4CF0ABEE29844B5500D66079 /* AnyEncodable.swift in Sources */,
|
4CF0ABEE29844B5500D66079 /* AnyEncodable.swift in Sources */,
|
||||||
B57B4C662B312C3700A232C0 /* NostrAuth.swift in Sources */,
|
B57B4C662B312C3700A232C0 /* NostrAuth.swift in Sources */,
|
||||||
4CB8838D296F710400DC99E7 /* Reposted.swift in Sources */,
|
4CB8838D296F710400DC99E7 /* Reposted.swift in Sources */,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import UIKit
|
|||||||
import SwiftUI
|
import SwiftUI
|
||||||
import PhotosUI
|
import PhotosUI
|
||||||
|
|
||||||
struct ImagePicker: UIViewControllerRepresentable {
|
struct MediaPicker: UIViewControllerRepresentable {
|
||||||
|
|
||||||
@Environment(\.presentationMode)
|
@Environment(\.presentationMode)
|
||||||
@Binding private var presentationMode
|
@Binding private var presentationMode
|
||||||
@@ -19,9 +19,9 @@ struct ImagePicker: UIViewControllerRepresentable {
|
|||||||
let onMediaPicked: (MediaUpload) -> Void
|
let onMediaPicked: (MediaUpload) -> Void
|
||||||
|
|
||||||
final class Coordinator: NSObject, PHPickerViewControllerDelegate {
|
final class Coordinator: NSObject, PHPickerViewControllerDelegate {
|
||||||
let parent: ImagePicker
|
let parent: MediaPicker
|
||||||
|
|
||||||
init(_ parent: ImagePicker) {
|
init(_ parent: MediaPicker) {
|
||||||
self.parent = parent
|
self.parent = parent
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -420,7 +420,7 @@ struct PostView: View {
|
|||||||
}
|
}
|
||||||
.background(DamusColors.adaptableWhite.edgesIgnoringSafeArea(.all))
|
.background(DamusColors.adaptableWhite.edgesIgnoringSafeArea(.all))
|
||||||
.sheet(isPresented: $attach_media) {
|
.sheet(isPresented: $attach_media) {
|
||||||
ImagePicker(image_upload_confirm: $image_upload_confirm) { media in
|
MediaPicker(image_upload_confirm: $image_upload_confirm) { media in
|
||||||
self.mediaToUpload = media
|
self.mediaToUpload = media
|
||||||
}
|
}
|
||||||
.alert(NSLocalizedString("Are you sure you want to upload this media?", comment: "Alert message asking if the user wants to upload media."), isPresented: $image_upload_confirm) {
|
.alert(NSLocalizedString("Are you sure you want to upload this media?", comment: "Alert message asking if the user wants to upload media."), isPresented: $image_upload_confirm) {
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ struct EditPictureControl: View {
|
|||||||
}
|
}
|
||||||
.sheet(isPresented: $show_camera) {
|
.sheet(isPresented: $show_camera) {
|
||||||
|
|
||||||
ImagePicker(image_upload_confirm: $image_upload_confirm, imagesOnly: true) { media in
|
MediaPicker(image_upload_confirm: $image_upload_confirm, imagesOnly: true) { media in
|
||||||
self.mediaToUpload = media
|
self.mediaToUpload = media
|
||||||
}
|
}
|
||||||
.alert(NSLocalizedString("Are you sure you want to upload this image?", comment: "Alert message asking if the user wants to upload an image."), isPresented: $image_upload_confirm) {
|
.alert(NSLocalizedString("Are you sure you want to upload this image?", comment: "Alert message asking if the user wants to upload an image."), isPresented: $image_upload_confirm) {
|
||||||
@@ -75,7 +75,7 @@ struct EditPictureControl: View {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
.sheet(isPresented: $show_library) {
|
.sheet(isPresented: $show_library) {
|
||||||
ImagePicker(image_upload_confirm: $image_upload_confirm, imagesOnly: true) { media in
|
MediaPicker(image_upload_confirm: $image_upload_confirm, imagesOnly: true) { media in
|
||||||
if case .image = media {
|
if case .image = media {
|
||||||
self.mediaToUpload = media
|
self.mediaToUpload = media
|
||||||
} else {
|
} else {
|
||||||
|
|||||||
Reference in New Issue
Block a user