Mercurial > public > simoleon
diff Simoleon/UI/SearchBar.swift @ 171:70f0625bfcf1
Merge pull request #17 from denniscm190/development
open source project
committer: GitHub <noreply@github.com>
author | Dennis C. M. <dennis@denniscm.com> |
---|---|
date | Tue, 12 Oct 2021 16:17:35 +0200 |
parents | Simoleon/Helpers/SearchBar.swift@04feeb708833 Simoleon/Helpers/SearchBar.swift@84137052813d |
children |
line wrap: on
line diff
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Simoleon/UI/SearchBar.swift Tue Oct 12 16:17:35 2021 +0200 @@ -0,0 +1,29 @@ +// +// SearchBar.swift +// Simoleon +// +// Created by Dennis Concepción Martín on 27/07/2021. +// + +import SwiftUI + +struct SearchBar: View { + var placeholder: LocalizedStringKey + @Binding var text: String + + var body: some View { + TextField(placeholder, text: $text) + .disableAutocorrection(true) + .padding(10) + .background( + RoundedRectangle(cornerRadius: 15) + .foregroundColor(Color(.tertiarySystemFill)) + ) + } +} + +struct SearchBar_Previews: PreviewProvider { + static var previews: some View { + SearchBar(placeholder: "Search ...", text: .constant("")) + } +}