aboutsummaryrefslogtreecommitdiff
path: root/Demo/SwiftyCropDemo/ShapeButton.swift
blob: c7aae9f1e8ae882ffc6c807685bdb40be1822357 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
//  ShapeButton.swift
//  SwiftyCropDemo
//
//  Created by Leonid Zolotarev on 1/24/24.
//

import SwiftUI
import SwiftyCrop

struct ShapeButton: View {
    let title: String
    let shape: MaskShape
    @Binding var selection: MaskShape

    var body: some View {
        Button {
            selection = shape
        } label: {
            LongText(title: title)
        }
        .foregroundColor(selection == shape ? .accentColor : .secondary)
    }
}

#Preview {
    ShapeButton(
        title: "title",
        shape: .circle,
        selection: .constant(.circle)
    )
}