MijickCamera/Sources/Internal/UI/Default Screens/Common Components/DefaultScreen+BottomButton.swift

38 lines
976 B
Swift
Raw Permalink Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//
// DefaultScreen+BottomButton.swift of MijickCamera
//
// Created by Tomasz Kurylik. Sending from Kraków!
// - Mail: tomasz.kurylik@mijick.com
// - GitHub: https://github.com/FulcrumOne
// - Medium: https://medium.com/@mijick
//
// Copyright ©2024 Mijick. All rights reserved.
import SwiftUI
struct BottomButton: View {
let icon: ImageResource
let iconColor: Color
let backgroundColor: Color
let rotationAngle: Angle
let action: () -> ()
var body: some View {
Button(action: action, label: createButtonLabel).buttonStyle(ButtonScaleStyle())
}
}
private extension BottomButton {
func createButtonLabel() -> some View {
Image(icon)
.resizable()
.frame(width: 26, height: 26)
.foregroundColor(iconColor)
.rotationEffect(rotationAngle)
.frame(width: 52, height: 52)
.background(backgroundColor)
.mask(Circle())
}
}