mastodon-app-ufficiale-ipho.../ShareActionExtension/Scene/View/StatusAuthorView.swift

47 lines
1.1 KiB
Swift
Raw Normal View History

2021-07-16 15:21:18 +02:00
//
// StatusAuthorView.swift
//
//
// Created by MainasuK Cirno on 2021-7-16.
//
import SwiftUI
2021-07-19 11:12:45 +02:00
import MastodonUI
2021-07-16 15:21:18 +02:00
import Nuke
import NukeFLAnimatedImagePlugin
import FLAnimatedImage
struct StatusAuthorView: View {
let avatarImageURL: URL?
let name: String
let username: String
var body: some View {
HStack(spacing: 5) {
AnimatedImage(imageURL: avatarImageURL)
.frame(width: 42, height: 42)
.background(Color(UIColor.systemFill))
2021-07-16 15:21:18 +02:00
.cornerRadius(4)
VStack(alignment: .leading) {
Text(name)
.font(.headline)
Text(username)
2021-07-16 15:21:18 +02:00
.font(.subheadline)
.foregroundColor(.secondary)
}
Spacer()
}
}
}
struct StatusAuthorView_Previews: PreviewProvider {
static var previews: some View {
StatusAuthorView(
avatarImageURL: URL(string: "https://upload.wikimedia.org/wikipedia/commons/2/2c/Rotating_earth_%28large%29.gif"),
name: "Alice",
username: "alice"
)
}
}