mirror of
https://github.com/SideStore/SideStore.git
synced 2026-02-09 06:43:25 +01:00
33 lines
726 B
Swift
33 lines
726 B
Swift
//
|
|
// SwiftUIView.swift
|
|
// SideStore
|
|
//
|
|
// Created by Fabian Thies on 18.11.22.
|
|
// Copyright © 2022 Fabian Thies. All rights reserved.
|
|
//
|
|
|
|
import SwiftUI
|
|
import AsyncImage
|
|
|
|
struct AppIconView: View {
|
|
let iconUrl: URL?
|
|
var size: CGFloat = 64
|
|
var cornerRadius: CGFloat {
|
|
size * 0.234
|
|
}
|
|
|
|
var body: some View {
|
|
if let iconUrl {
|
|
AsyncImage(url: iconUrl) { image in
|
|
image
|
|
.resizable()
|
|
} placeholder: {
|
|
Color(UIColor.secondarySystemBackground)
|
|
}
|
|
.frame(width: size, height: size)
|
|
.clipShape(RoundedRectangle(cornerRadius: cornerRadius, style: .continuous))
|
|
}
|
|
}
|
|
}
|
|
|