-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
#Conflicts: # Splito/Localization/Localizable.xcstrings # Splito/UI/Home/Expense/AddExpenseViewModel.swift
- Loading branch information
Showing
42 changed files
with
1,072 additions
and
192 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
BaseStyle/BaseStyle/Resource/BaseAssets.xcassets/Images/SendIcon.imageset/Contents.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "send.icon.svg", | ||
"idiom" : "universal" | ||
}, | ||
{ | ||
"appearances" : [ | ||
{ | ||
"appearance" : "luminosity", | ||
"value" : "dark" | ||
} | ||
], | ||
"filename" : "send.icon (1).svg", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
...seStyle/Resource/BaseAssets.xcassets/Images/SendIcon.imageset/send.icon (1).svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions
3
...e/BaseStyle/Resource/BaseAssets.xcassets/Images/SendIcon.imageset/send.icon.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
// | ||
// CommentTextFieldView.swift | ||
// BaseStyle | ||
// | ||
// Created by Nirali Sonani on 13/01/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct CommentTextFieldView: View { | ||
|
||
@Binding var comment: String | ||
@Binding var showLoader: Bool | ||
var isFocused: FocusState<Bool>.Binding | ||
|
||
let onSendCommentBtnTap: () -> Void | ||
|
||
public init(comment: Binding<String>, showLoader: Binding<Bool>, | ||
isFocused: FocusState<Bool>.Binding, onSendCommentBtnTap: @escaping () -> Void) { | ||
self._comment = comment | ||
self._showLoader = showLoader | ||
self.isFocused = isFocused | ||
self.onSendCommentBtnTap = onSendCommentBtnTap | ||
} | ||
|
||
public var body: some View { | ||
VStack(spacing: 0) { | ||
Divider() | ||
.frame(height: 1) | ||
.background(dividerColor) | ||
|
||
HStack(alignment: .center, spacing: 8) { | ||
TextField("Add a comment", text: $comment, axis: .vertical) | ||
.font(.body1()) | ||
.foregroundStyle(primaryText) | ||
.tint(primaryColor) | ||
.focused(isFocused) | ||
.textInputAutocapitalization(.sentences) | ||
.padding(.vertical, 8) | ||
.padding(.horizontal, 16) | ||
.overlay { | ||
RoundedRectangle(cornerRadius: 12) | ||
.stroke(outlineColor, lineWidth: 1) | ||
} | ||
.padding(.leading, 16) | ||
.padding(.vertical, 8) | ||
.lineLimit(3) | ||
|
||
CommentSendBtnView(showLoader: $showLoader, onClick: onSendCommentBtnTap) | ||
.disabled(comment.trimming(spaces: .leadingAndTrailing).isEmpty) | ||
} | ||
} | ||
} | ||
} | ||
|
||
private struct CommentSendBtnView: View { | ||
|
||
@Binding var showLoader: Bool | ||
|
||
let onClick: () -> Void | ||
|
||
var body: some View { | ||
if !showLoader { | ||
Button(action: onClick) { | ||
Image(.sendIcon) | ||
.resizable() | ||
.scaledToFit() | ||
.frame(width: 20, height: 20) | ||
.padding(8) | ||
.overlay(content: { | ||
RoundedRectangle(cornerRadius: 12) | ||
.fill(container2Color) | ||
}) | ||
.padding(.trailing, 16) | ||
} | ||
} else { | ||
ImageLoaderView() | ||
.padding(12) | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
// | ||
// SectionHeaderView.swift | ||
// Splito | ||
// | ||
// Created by Nirali Sonani on 09/01/25. | ||
// | ||
|
||
import SwiftUI | ||
|
||
public struct SectionHeaderView: View { | ||
|
||
let text: String | ||
let font: Font | ||
let textColor: Color | ||
let alignment: Alignment | ||
let horizontalPadding: CGFloat | ||
|
||
public init(text: String, font: Font = .subTitle3(), textColor: Color = disableText, | ||
alignment: Alignment = .leading, horizontalPadding: CGFloat = 16) { | ||
self.text = text | ||
self.font = font | ||
self.textColor = textColor | ||
self.alignment = alignment | ||
self.horizontalPadding = horizontalPadding | ||
} | ||
|
||
public var body: some View { | ||
Text(text.localized) | ||
.font(font) | ||
.foregroundStyle(textColor) | ||
.frame(maxWidth: .infinity, alignment: alignment) | ||
.padding(.horizontal, horizontalPadding) | ||
} | ||
} |
Oops, something went wrong.