-
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.
- Loading branch information
1 parent
66e3525
commit f5dfbe8
Showing
25 changed files
with
385 additions
and
112 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
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,79 @@ | ||
// | ||
// ProfileImageView.swift | ||
// BaseStyle | ||
// | ||
// Created by Amisha Italiya on 01/04/24. | ||
// | ||
|
||
import SwiftUI | ||
import Kingfisher | ||
|
||
public struct MemberProfileImageView: View { | ||
|
||
let imageUrl: String? | ||
|
||
public init(imageUrl: String?) { | ||
self.imageUrl = imageUrl | ||
} | ||
|
||
public var body: some View { | ||
VStack(spacing: 0) { | ||
if let imageUrl, let url = URL(string: imageUrl) { | ||
KFImage(url) | ||
.placeholder({ _ in | ||
ImageLoaderView() | ||
}) | ||
.setProcessor(ResizingImageProcessor(referenceSize: CGSize(width: (50 * UIScreen.main.scale), height: (50 * UIScreen.main.scale)), mode: .aspectFill)) | ||
.resizable() | ||
.scaledToFill() | ||
.frame(width: 50, height: 50, alignment: .center) | ||
.clipShape(RoundedRectangle(cornerRadius: 25)) | ||
.overlay( | ||
Circle() | ||
.strokeBorder(Color.gray, lineWidth: 1) | ||
) | ||
} else { | ||
Image(.user) | ||
.resizable() | ||
.scaledToFill() | ||
.frame(width: 50, height: 50, alignment: .center) | ||
.clipShape(RoundedRectangle(cornerRadius: 25)) | ||
.overlay( | ||
Circle() | ||
.strokeBorder(Color.gray, lineWidth: 1) | ||
) | ||
} | ||
} | ||
} | ||
} | ||
|
||
public struct GroupProfileImageView: View { | ||
|
||
let imageUrl: String? | ||
|
||
public init(imageUrl: String?) { | ||
self.imageUrl = imageUrl | ||
} | ||
|
||
public var body: some View { | ||
VStack(spacing: 0) { | ||
if let imageUrl, let url = URL(string: imageUrl) { | ||
KFImage(url) | ||
.placeholder({ _ in | ||
ImageLoaderView() | ||
}) | ||
.setProcessor(ResizingImageProcessor(referenceSize: CGSize(width: (50 * UIScreen.main.scale), height: (50 * UIScreen.main.scale)), mode: .aspectFill)) | ||
.resizable() | ||
.scaledToFill() | ||
.frame(width: 50, height: 50, alignment: .center) | ||
.clipShape(RoundedRectangle(cornerRadius: 8)) | ||
} else { | ||
Image(.group) | ||
.resizable() | ||
.scaledToFill() | ||
.frame(width: 50, height: 50, alignment: .center) | ||
.clipShape(RoundedRectangle(cornerRadius: 8)) | ||
} | ||
} | ||
} | ||
} |
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
20 changes: 20 additions & 0 deletions
20
...aseStyle/Resource/BaseAssets.xcassets/Colors/DisableLightTextColor.colorset/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,20 @@ | ||
{ | ||
"colors" : [ | ||
{ | ||
"color" : { | ||
"color-space" : "display-p3", | ||
"components" : { | ||
"alpha" : "1.000", | ||
"blue" : "0xED", | ||
"green" : "0xE8", | ||
"red" : "0xE6" | ||
} | ||
}, | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
BaseStyle/BaseStyle/Resource/BaseAssets.xcassets/Images/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,6 @@ | ||
{ | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
12 changes: 12 additions & 0 deletions
12
BaseStyle/BaseStyle/Resource/BaseAssets.xcassets/Images/Group.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Group.png", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+112 KB
BaseStyle/BaseStyle/Resource/BaseAssets.xcassets/Images/Group.imageset/Group.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions
12
BaseStyle/BaseStyle/Resource/BaseAssets.xcassets/Images/User.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,12 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "User.png", | ||
"idiom" : "universal" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+10 KB
BaseStyle/BaseStyle/Resource/BaseAssets.xcassets/Images/User.imageset/User.png
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
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
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
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
Oops, something went wrong.