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 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)
|
2021-07-20 10:40:04 +02:00
|
|
|
.background(Color(UIColor.systemFill))
|
2021-07-16 15:21:18 +02:00
|
|
|
.cornerRadius(4)
|
|
|
|
VStack(alignment: .leading) {
|
|
|
|
Text(name)
|
|
|
|
.font(.headline)
|
2021-07-20 10:40:04 +02:00
|
|
|
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"
|
|
|
|
)
|
|
|
|
}
|
|
|
|
}
|