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 1d86b1e3e..e63aae12d 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/DocumentView_SwiftUI.swift @@ -67,32 +67,34 @@ struct DocumentView_SwiftUI: View { } } -#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 - ) +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 + ) + } } } 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 db1019ef1..15e5080cb 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/LinkPreviewView_SwiftUI.swift @@ -127,28 +127,30 @@ public struct LinkPreviewView_SwiftUI: View { } } -#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) +struct LinkPreview_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) + } } } 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 049a32ddc..b3e1adc57 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/OpenGroupInvitationView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/OpenGroupInvitationView_SwiftUI.swift @@ -83,11 +83,13 @@ struct OpenGroupInvitationView_SwiftUI: View { } } -#Preview { - OpenGroupInvitationView_SwiftUI( - name: "Session", - url: "http://open.getsession.org/session?public_key=a03c383cf63c3c4efe67acc52112a6dd734b3a946b9545f488aaa93da7991238", - textColor: .messageBubble_outgoingText, - isOutgoing: true - ) +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 + ) + } } diff --git a/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift b/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift index d99cde22b..49be91eca 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/QuoteView_SwiftUI.swift @@ -206,22 +206,24 @@ struct QuoteView_SwiftUI: View { } } -#Preview { - ZStack { - if #available(iOS 14.0, *) { - ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary).ignoresSafeArea() - } else { - ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary) - } - - QuoteView_SwiftUI( - info: QuoteView_SwiftUI.Info( - mode: .draft, - authorId: "", - threadVariant: .contact, - direction: .outgoing +struct QuoteView_SwiftUI_Previews: PreviewProvider { + static var previews: some View { + ZStack { + if #available(iOS 14.0, *) { + ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary).ignoresSafeArea() + } else { + ThemeManager.currentTheme.colorSwiftUI(for: .backgroundPrimary) + } + + QuoteView_SwiftUI( + info: QuoteView_SwiftUI.Info( + mode: .draft, + authorId: "", + threadVariant: .contact, + direction: .outgoing + ) ) - ) - .frame(height: 40) + .frame(height: 40) + } } } 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 3586d6151..1606480f2 100644 --- a/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift +++ b/Session/Conversations/Message Cells/Content Views/SwiftUI/VoiceMessageView_SwiftUI.swift @@ -81,13 +81,15 @@ struct VoiceMessageView_SwiftUI: View { } } -#Preview { - VoiceMessageView_SwiftUI( - attachment: Attachment( - variant: .voiceMessage, - contentType: "mp4", - byteCount: 100 +struct VoiceMessageView_SwiftUI_Previews: PreviewProvider { + static var previews: some View { + VoiceMessageView_SwiftUI( + attachment: Attachment( + variant: .voiceMessage, + contentType: "mp4", + byteCount: 100 + ) ) - ) - .frame(height: 58) + .frame(height: 58) + } } diff --git a/Session/Shared/LoadingIndicatorView.swift b/Session/Shared/LoadingIndicatorView.swift index 42fab179a..267a96f35 100644 --- a/Session/Shared/LoadingIndicatorView.swift +++ b/Session/Shared/LoadingIndicatorView.swift @@ -72,12 +72,12 @@ public struct ActivityIndicator: View { } } -#Preview { - ActivityIndicator(themeColor: .textPrimary, width: 2) - .frame( - width: 40, - height: 40 - ) +struct ActivityIndicator_Previews: PreviewProvider { + static var previews: some View { + ActivityIndicator(themeColor: .textPrimary, width: 2) + .frame( + width: 40, + height: 40 + ) + } } - -