Skip to content

Commit

Permalink
✨ Hardcode images
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed Jun 15, 2024
1 parent c4dc332 commit cfddd0e
Show file tree
Hide file tree
Showing 15 changed files with 96 additions and 25 deletions.
6 changes: 6 additions & 0 deletions Loop/Assets.xcassets/Credits/Contents.json
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 Loop/Assets.xcassets/Credits/github.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "GitHub-Mark-ea2971cee799.png",
"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.
12 changes: 12 additions & 0 deletions Loop/Assets.xcassets/Credits/greglassale.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "eNO2LxOQ_200x200.jpg",
"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.
12 changes: 12 additions & 0 deletions Loop/Assets.xcassets/Credits/jace.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "U5MArPgZ_200x200.jpg",
"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.
12 changes: 12 additions & 0 deletions Loop/Assets.xcassets/Credits/jsdev.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "80474621.png",
"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.
12 changes: 12 additions & 0 deletions Loop/Assets.xcassets/Credits/kai.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "68963405.png",
"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.
12 changes: 12 additions & 0 deletions Loop/Assets.xcassets/Credits/kami.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "103985728.jpeg",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
41 changes: 17 additions & 24 deletions Loop/Luminare/Loop/AboutConfiguration.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,37 +25,37 @@ class AboutConfigurationModel: ObservableObject {
"Kai",
"Development",
url: .init(string: "https://github.com/mrkai77")!,
avatar: .init(string: "https://github.com/mrkai77.png?size=200")!
avatar: Image(.kai)
),
.init(
"Jace",
"Design",
url: .init(string: "https://x.com/jacethings")!,
avatar: .init(string: "https://github.com/soft-bred.png?size=200")!
avatar: Image(.jace)
),
.init(
"Kami",
"Development support",
url: .init(string: "https://github.com/senpaihunters")!,
avatar: .init(string: "https://github.com/senpaihunters.png?size=200")!
avatar: Image(.kami)
),
.init(
"Greg Lassale",
"Icon contributor",
url: .init(string: "https://x.com/greglassale")!,
avatar: .init(string: "https://pbs.twimg.com/profile_images/1746348765127094272/eNO2LxOQ_200x200.jpg")!
avatar: Image(.greglassale)
),
.init(
"JSDev",
"Icon contributor",
url: .init(string: "https://github.com/N-coder82")!,
avatar: .init(string: "https://github.com/n-coder82.png?size=200")!
avatar: Image(.jsdev)
),
.init(
"Contributors on GitHub",
"Some features, ideas, and bug fixes",
url: .init(string: "https://github.com/MrKai77/Loop/graphs/contributors")!,
avatar: .init(string: "https://github.githubassets.com/assets/GitHub-Mark-ea2971cee799.png?size=200")!
avatar: Image(.github)
)
]

Expand All @@ -75,9 +75,9 @@ struct CreditItem: Identifiable {
let name: String
let description: LocalizedStringKey?
let url: URL
let avatar: URL
let avatar: Image

init(_ name: String, _ description: LocalizedStringKey? = nil, url: URL, avatar: URL) {
init(_ name: String, _ description: LocalizedStringKey? = nil, url: URL, avatar: Image) {
self.name = name
self.description = description
self.avatar = avatar
Expand Down Expand Up @@ -163,22 +163,15 @@ struct AboutConfigurationView: View {
openURL(credit.url)
} label: {
HStack(spacing: 12) {
AsyncImage(url: credit.avatar) { image in
image
.resizable()
.aspectRatio(contentMode: .fit)
} placeholder: {
Image(systemName: "person.crop.circle")
.resizable()
.foregroundStyle(.tertiary)
.aspectRatio(contentMode: .fit)
}
.frame(height: 40)
.overlay {
Circle()
.strokeBorder(.white.opacity(0.1), lineWidth: 1)
}
.clipShape(.circle)
credit.avatar
.resizable()
.aspectRatio(contentMode: .fit)
.frame(height: 40)
.overlay {
Circle()
.strokeBorder(.white.opacity(0.1), lineWidth: 1)
}
.clipShape(.circle)

VStack(alignment: .leading) {
Text(credit.name)
Expand Down
2 changes: 1 addition & 1 deletion Luminare

0 comments on commit cfddd0e

Please sign in to comment.