-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/juandahurt/Purace into icon
- Loading branch information
Showing
7 changed files
with
66 additions
and
25 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,19 @@ | ||
// | ||
// ImageExample.swift | ||
// PuraceDemo | ||
// | ||
// Created by Juan Hurtado on 23/05/22. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
import Purace | ||
|
||
struct ImageExample: View { | ||
var body: some View { | ||
Text("`PraceImageView(url: ...)`") | ||
PuraceImageView(url: URL(string: "https://www.biografiasyvidas.com/biografia/c/fotos/caldas_francisco_jose_2.jpg")) | ||
.frame(width: 150, height: 150) | ||
Spacer() | ||
} | ||
} |
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 |
---|---|---|
@@ -1,3 +1,7 @@ | ||
# Purace | ||
|
||
<p align="center"> | ||
<img src="https://user-images.githubusercontent.com/26754335/169919656-cb022f8a-53fe-4823-822e-1d7c14b66479.svg" width=100> | ||
</p> | ||
|
||
Contains all the views and styles that [Payan](https://github.com/juandahurt/payan-ios) uses. |
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 @@ | ||
// | ||
// PuraceImageView.swift | ||
// | ||
// | ||
// Created by Juan Hurtado on 23/05/22. | ||
// | ||
|
||
import Foundation | ||
import SwiftUI | ||
import Kingfisher | ||
|
||
public struct PuraceImageView: View { | ||
let url: URL? | ||
|
||
public init(url: URL?) { | ||
self.url = url | ||
} | ||
|
||
public var body: some View { | ||
KFImage.url(url) | ||
.resizable() | ||
.fade(duration: 0.2) | ||
.placeholder { _ in | ||
GeometryReader { reader in | ||
ZStack { | ||
PuraceCircularLoaderView() | ||
.foregroundColor(PuraceStyle.Color.G3) | ||
.frame(width: reader.size.width * 0.1, height: reader.size.width * 0.1) | ||
.position(x: reader.size.width / 2, y: reader.size.height / 2) | ||
} | ||
} | ||
} | ||
} | ||
} |
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