2023-01-24 12:22:53 +01:00
|
|
|
//
|
|
|
|
// https://mczachurski.dev
|
|
|
|
// Copyright © 2023 Marcin Czachurski and the repository contributors.
|
|
|
|
// Licensed under the MIT License.
|
|
|
|
//
|
|
|
|
|
|
|
|
import Foundation
|
|
|
|
import SwiftUI
|
|
|
|
|
2023-03-11 18:30:33 +01:00
|
|
|
extension AvatarShape {
|
2023-01-24 12:22:53 +01:00
|
|
|
func shape() -> some Shape {
|
|
|
|
switch self {
|
|
|
|
case .circle:
|
|
|
|
return AnyShape(Circle())
|
|
|
|
case .roundedRectangle:
|
2023-03-12 08:39:12 +01:00
|
|
|
return AnyShape(RoundedRectangle(cornerRadius: 5.0))
|
2023-01-24 12:22:53 +01:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|