Skip to content

Commit

Permalink
Merge branch 'main'
Browse files Browse the repository at this point in the history
#Conflicts:
#	Splito/Localization/Localizable.xcstrings
#	Splito/UI/Home/Expense/AddExpenseViewModel.swift
  • Loading branch information
cp-amisha-i committed Jan 16, 2025
2 parents 89b6ba7 + e0508f3 commit e0f054e
Show file tree
Hide file tree
Showing 42 changed files with 1,072 additions and 192 deletions.
8 changes: 8 additions & 0 deletions BaseStyle/BaseStyle.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,10 @@
219F43D92CCA4A7000729C67 /* RestoreButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 219F43D82CCA4A7000729C67 /* RestoreButton.swift */; };
21BEF8A52C637E4900FBC9CF /* NavigationBarTopView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BEF8A42C637E4900FBC9CF /* NavigationBarTopView.swift */; };
21BEF8A72C6399BA00FBC9CF /* BottomSheetHeightModifier.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21BEF8A62C6399BA00FBC9CF /* BottomSheetHeightModifier.swift */; };
21C9A7D82D355870006C84CE /* CommentTextFieldView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21C9A7D72D355870006C84CE /* CommentTextFieldView.swift */; };
21D26E232CA199630090488B /* CapsuleButton.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D26E222CA199610090488B /* CapsuleButton.swift */; };
21D614792CAD527D00779F1E /* NavigationTitleTextView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21D614782CAD527D00779F1E /* NavigationTitleTextView.swift */; };
21F41AFA2D30110C00D37DBB /* SectionHeaderView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 21F41AF92D30110C00D37DBB /* SectionHeaderView.swift */; };
5DAEE93D2D2208132D031984 /* Pods_BaseStyleTests.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E4AFAF996FB5C233D40D81D5 /* Pods_BaseStyleTests.framework */; };
A40018A9B957803B8105BEA5 /* Pods_BaseStyle.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 174198EE4AF2FC82DADEB060 /* Pods_BaseStyle.framework */; };
D82174BE2BBAD86D00DB42C3 /* ProfileImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D82174BD2BBAD86D00DB42C3 /* ProfileImageView.swift */; };
Expand Down Expand Up @@ -79,8 +81,10 @@
219F43D82CCA4A7000729C67 /* RestoreButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = RestoreButton.swift; sourceTree = "<group>"; };
21BEF8A42C637E4900FBC9CF /* NavigationBarTopView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationBarTopView.swift; sourceTree = "<group>"; };
21BEF8A62C6399BA00FBC9CF /* BottomSheetHeightModifier.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = BottomSheetHeightModifier.swift; sourceTree = "<group>"; };
21C9A7D72D355870006C84CE /* CommentTextFieldView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CommentTextFieldView.swift; sourceTree = "<group>"; };
21D26E222CA199610090488B /* CapsuleButton.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CapsuleButton.swift; sourceTree = "<group>"; };
21D614782CAD527D00779F1E /* NavigationTitleTextView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationTitleTextView.swift; sourceTree = "<group>"; };
21F41AF92D30110C00D37DBB /* SectionHeaderView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SectionHeaderView.swift; sourceTree = "<group>"; };
2CE85328C46B183FC3F074A3 /* Pods-BaseStyle.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BaseStyle.release.xcconfig"; path = "Target Support Files/Pods-BaseStyle/Pods-BaseStyle.release.xcconfig"; sourceTree = "<group>"; };
5BDB5B9B63CFD771230CD759 /* Pods-BaseStyleTests.release.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BaseStyleTests.release.xcconfig"; path = "Target Support Files/Pods-BaseStyleTests/Pods-BaseStyleTests.release.xcconfig"; sourceTree = "<group>"; };
CC9EC1F1C0A5A0821118E6CA /* Pods-BaseStyleTests.debug.xcconfig */ = {isa = PBXFileReference; includeInIndex = 1; lastKnownFileType = text.xcconfig; name = "Pods-BaseStyleTests.debug.xcconfig"; path = "Target Support Files/Pods-BaseStyleTests/Pods-BaseStyleTests.debug.xcconfig"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -275,6 +279,8 @@
219F43D82CCA4A7000729C67 /* RestoreButton.swift */,
D8EB5E942CF8B12B005B68D9 /* ZoomableImageView.swift */,
D8FFD5C62CF44DBC009A0667 /* AttachmentZoomView.swift */,
21F41AF92D30110C00D37DBB /* SectionHeaderView.swift */,
21C9A7D72D355870006C84CE /* CommentTextFieldView.swift */,
);
path = Views;
sourceTree = "<group>";
Expand Down Expand Up @@ -511,6 +517,7 @@
21BEF8A52C637E4900FBC9CF /* NavigationBarTopView.swift in Sources */,
D8D42A832B85D07C009B345D /* View+Extension.swift in Sources */,
D89DBE3E2B8C67CE00E5F1BD /* String+Extension.swift in Sources */,
21C9A7D82D355870006C84CE /* CommentTextFieldView.swift in Sources */,
D8E244C32B986D4F00C6C82A /* UIImage+Extension.swift in Sources */,
D8D42A822B85D07C009B345D /* PrimaryButton.swift in Sources */,
21BEF8A72C6399BA00FBC9CF /* BottomSheetHeightModifier.swift in Sources */,
Expand All @@ -536,6 +543,7 @@
D8D14A502BA090F000F45FF2 /* ShareSheetView.swift in Sources */,
D8E244B52B972AD200C6C82A /* EmptyRouteView.swift in Sources */,
D8D42A842B85D07C009B345D /* Spacers.swift in Sources */,
21F41AFA2D30110C00D37DBB /* SectionHeaderView.swift in Sources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down
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
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 2 additions & 9 deletions BaseStyle/BaseStyle/Views/AttachmentZoomView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,12 @@ import Kingfisher

public struct AttachmentContainerView: View {

@Binding var showImageDisplayView: Bool

var image: UIImage?
var imageUrl: String?

@Namespace private var animationNamespace

public init(showImageDisplayView: Binding<Bool>, image: UIImage? = nil, imageUrl: String? = nil) {
self._showImageDisplayView = showImageDisplayView
public init(image: UIImage? = nil, imageUrl: String? = nil) {
self.image = image
self.imageUrl = imageUrl
}
Expand All @@ -30,7 +27,6 @@ public struct AttachmentContainerView: View {
if let image {
Image(uiImage: image)
.resizable()
.aspectRatio(contentMode: .fill)
} else if let imageUrl, let url = URL(string: imageUrl) {
KFImage(url)
.placeholder { _ in
Expand All @@ -39,13 +35,10 @@ public struct AttachmentContainerView: View {
.setProcessor(DownsamplingImageProcessor(size: UIScreen.main.bounds.size)) // Downsample to fit screen size
.cacheMemoryOnly()
.resizable()
.aspectRatio(contentMode: .fill)
}
}
.aspectRatio(contentMode: .fill)
.matchedGeometryEffect(id: "image", in: animationNamespace)
.onTapGestureForced {
showImageDisplayView = true
}
}
}

Expand Down
81 changes: 81 additions & 0 deletions BaseStyle/BaseStyle/Views/CommentTextFieldView.swift
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)
}
}
}
34 changes: 34 additions & 0 deletions BaseStyle/BaseStyle/Views/SectionHeaderView.swift
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)
}
}
Loading

0 comments on commit e0f054e

Please sign in to comment.