//
//  TextColorPickerView.swift
//  Feels (iOS)
//
//  Created by Trey Tartt on 4/2/22.
//

import SwiftUI

struct TextColorPickerView: View {
    @AppStorage(UserDefaultsStore.Keys.theme.rawValue, store: GroupUserDefaults.groupDefaults) private var theme: Theme = .system
    @AppStorage(UserDefaultsStore.Keys.textColor.rawValue, store: GroupUserDefaults.groupDefaults) private var textColor: Color = DefaultTextColor.textColor
    
    var body: some View {
        ZStack {
            theme.currentTheme.secondaryBGColor
            ColorPicker(String(localized: "customize_view_view_text_color"), selection: $textColor)
                .padding()
                .foregroundColor(textColor)
        }
        .fixedSize(horizontal: false, vertical: true)
        .cornerRadius(Constants.viewsCornerRaidus, corners: [.topLeft, .topRight, .bottomLeft, .bottomRight])
    }
}

struct TextColorPickerView_Previews: PreviewProvider {
    static var previews: some View {
        TextColorPickerView()
    }
}
