Skip to content

Commit

Permalink
feat: bottom button
Browse files Browse the repository at this point in the history
  • Loading branch information
alsh0807 committed Jul 25, 2024
1 parent 516eab9 commit 6f2482c
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 4 deletions.
23 changes: 23 additions & 0 deletions Sources/SDS/Component/Button/SopoBottomButton.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import SwiftUI

public struct SopoBottomButton: View {
let text: Text
let background: Color

public init(_ text: () -> Text, background: Color = .primary(.normal)) {
self.text = text()
self.background = background
}

public var body: some View {
Button {} label: {
RoundedRectangle(cornerRadius: 12)
.frame(height: 56)
.padding(.horizontal, 36)
.foregroundStyle(background)
.overlay {
text
}
}
}
}
8 changes: 4 additions & 4 deletions Sources/SDS/Component/TextField/SopoTextField.swift
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
import SwiftUI

struct SopoTextField: View {
public struct SopoTextField: View {

@Binding var text: String
let prompt: String
let isSecure: Bool
let inputType: NSTextContentType?
let trailing: AnyView?

init(text: Binding<String>, prompt: String, isSecure: Bool = false, inputType: NSTextContentType? = .none, trailing: @escaping () -> some View) {
public init(text: Binding<String>, prompt: String, isSecure: Bool = false, inputType: NSTextContentType? = .none, trailing: @escaping () -> some View) {
self._text = text
self.prompt = prompt
self.isSecure = isSecure
self.inputType = inputType
self.trailing = AnyView(trailing())
}

init(text: Binding<String>, prompt: String, isSecure: Bool = false, inputType: NSTextContentType? = .none) {
public init(text: Binding<String>, prompt: String, isSecure: Bool = false, inputType: NSTextContentType? = .none) {
self._text = text
self.prompt = prompt
self.isSecure = isSecure
Expand All @@ -25,7 +25,7 @@ struct SopoTextField: View {
}


var body: some View {
public var body: some View {
RoundedRectangle(cornerRadius: 12)
.strokeBorder(Color.label(.disable))
.background(Color.common(.w100).clipShape(RoundedRectangle(cornerRadius: 12)))
Expand Down

0 comments on commit 6f2482c

Please sign in to comment.