diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift index ef056915b..2b6839f90 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift @@ -71,34 +71,32 @@ struct DocumentView_SwiftUI: View { } } -struct DocumentView_SwiftUI_Previews: PreviewProvider { - static var previews: some View { - VStack { - DocumentView_SwiftUI( - attachment: Attachment( - variant: .standard, - contentType: "audio/mp4", - byteCount: 100 - ), - textColor: .messageBubble_outgoingText - ) - .frame( - width: 200, - height: 58 - ) - - DocumentView_SwiftUI( - attachment: Attachment( - variant: .standard, - contentType: "txt", - byteCount: 1000 - ), - textColor: .messageBubble_outgoingText - ) - .frame( - width: 200, - height: 58 - ) - } +#Preview { + VStack { + DocumentView_SwiftUI( + attachment: Attachment( + variant: .standard, + contentType: "audio/mp4", + byteCount: 100 + ), + textColor: .messageBubble_outgoingText + ) + .frame( + width: 200, + height: 58 + ) + + DocumentView_SwiftUI( + attachment: Attachment( + variant: .standard, + contentType: "txt", + byteCount: 1000 + ), + textColor: .messageBubble_outgoingText + ) + .frame( + width: 200, + height: 58 + ) } } diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift index 0cf86a5fb..99a3a09ee 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift @@ -134,30 +134,28 @@ public struct LinkPreviewView_SwiftUI: View { } } -struct LinkPreviewView_SwiftUI_Previews: PreviewProvider { - static var previews: some View { - VStack { - LinkPreviewView_SwiftUI( - state: LinkPreview.DraftState( - linkPreviewDraft: .init( - urlString: "https://github.com/oxen-io", - title: "Github - oxen-io/session-ios: A private messenger for iOS.", - jpegImageData: UIImage(named: "AppIcon")?.jpegData(compressionQuality: 1) - ) - ), - isOutgoing: true - ) - .padding(.horizontal, Values.mediumSpacing) - - LinkPreviewView_SwiftUI( - state: LinkPreview.LoadingState(), - isOutgoing: true - ) - .frame( - width: .infinity, - height: 80 - ) - .padding(.horizontal, Values.mediumSpacing) - } +#Preview { + VStack { + LinkPreviewView_SwiftUI( + state: LinkPreview.DraftState( + linkPreviewDraft: .init( + urlString: "https://github.com/oxen-io", + title: "Github - oxen-io/session-ios: A private messenger for iOS.", + jpegImageData: UIImage(named: "AppIcon")?.jpegData(compressionQuality: 1) + ) + ), + isOutgoing: true + ) + .padding(.horizontal, Values.mediumSpacing) + + LinkPreviewView_SwiftUI( + state: LinkPreview.LoadingState(), + isOutgoing: true + ) + .frame( + width: .infinity, + height: 80 + ) + .padding(.horizontal, Values.mediumSpacing) } } diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/OpenGroupInvitationView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/OpenGroupInvitationView_SwiftUI.swift index b3e1adc57..049a32ddc 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/OpenGroupInvitationView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/OpenGroupInvitationView_SwiftUI.swift @@ -83,13 +83,11 @@ struct OpenGroupInvitationView_SwiftUI: View { } } -struct OpenGroupInvitationView_SwiftUI_Previews: PreviewProvider { - static var previews: some View { - OpenGroupInvitationView_SwiftUI( - name: "Session", - url: "http://open.getsession.org/session?public_key=a03c383cf63c3c4efe67acc52112a6dd734b3a946b9545f488aaa93da7991238", - textColor: .messageBubble_outgoingText, - isOutgoing: true - ) - } +#Preview { + OpenGroupInvitationView_SwiftUI( + name: "Session", + url: "http://open.getsession.org/session?public_key=a03c383cf63c3c4efe67acc52112a6dd734b3a946b9545f488aaa93da7991238", + textColor: .messageBubble_outgoingText, + isOutgoing: true + ) } diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift index 919997a58..2d1d470f1 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift @@ -79,9 +79,13 @@ struct VoiceMessageView_SwiftUI: View { } } -struct VoiceMessageView_SwiftUI_Previews: PreviewProvider { - static var previews: some View { - VoiceMessageView_SwiftUI(attachment: Attachment(variant: .voiceMessage, contentType: "mp4", byteCount: 100)) - .frame(height: 58) - } +#Preview { + VoiceMessageView_SwiftUI( + attachment: Attachment( + variant: .voiceMessage, + contentType: "mp4", + byteCount: 100 + ) + ) + .frame(height: 58) } diff --git a/Session/Shared/LoadingIndicatorView.swift b/Session/Shared/LoadingIndicatorView.swift index e4e384e55..42fab179a 100644 --- a/Session/Shared/LoadingIndicatorView.swift +++ b/Session/Shared/LoadingIndicatorView.swift @@ -72,14 +72,12 @@ public struct ActivityIndicator: View { } } -struct ActivityIndicator_Previews: PreviewProvider { - static var previews: some View { - ActivityIndicator(themeColor: .textPrimary, width: 2) - .frame( - width: 40, - height: 40 - ) - } +#Preview { + ActivityIndicator(themeColor: .textPrimary, width: 2) + .frame( + width: 40, + height: 40 + ) } diff --git a/Session/Shared/SessionCarouselView+SwiftUI.swift b/Session/Shared/SessionCarouselView+SwiftUI.swift index d626a1c18..dc3d07f42 100644 --- a/Session/Shared/SessionCarouselView+SwiftUI.swift +++ b/Session/Shared/SessionCarouselView+SwiftUI.swift @@ -207,7 +207,22 @@ struct SessionCarouselView_SwiftUI_Previews: PreviewProvider { Color.black } - SessionCarouselView_SwiftUI(index: $index, isOutgoing: true, contentInfos: []) + SessionCarouselView_SwiftUI( + index: $index, + isOutgoing: true, + contentInfos: [ + Attachment( + variant: .standard, + contentType: "jpeg", + byteCount: 100 + ), + Attachment( + variant: .standard, + contentType: "jpeg", + byteCount: 100 + ) + ] + ) } } }