mirror of
https://github.com/stoatchat/for-ios.git
synced 2026-07-19 16:43:34 -04:00
30 lines
690 B
Swift
30 lines
690 B
Swift
//
|
|
// CheckboxStyle.swift
|
|
// Revolt
|
|
//
|
|
// Created by Angelo on 19/06/2024.
|
|
//
|
|
|
|
import SwiftUI
|
|
|
|
struct CheckboxStyle: ToggleStyle {
|
|
@EnvironmentObject var viewState: ViewState
|
|
|
|
func makeBody(configuration: Self.Configuration) -> some View {
|
|
return HStack {
|
|
configuration.label
|
|
|
|
Spacer()
|
|
|
|
if configuration.isOn {
|
|
Image(systemName: "checkmark")
|
|
.resizable()
|
|
.frame(width: 16, height: 16)
|
|
.foregroundColor(viewState.theme.accent.color)
|
|
}
|
|
|
|
}
|
|
.onTapGesture { configuration.isOn.toggle() }
|
|
}
|
|
}
|