Skip to content

Commit

Permalink
✨ Move GitHub contributors to its own CreditItem
Browse files Browse the repository at this point in the history
  • Loading branch information
MrKai77 committed May 28, 2024
1 parent 5f3fb18 commit 4eb98a0
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 21 deletions.
6 changes: 3 additions & 3 deletions Loop/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
"strings" : {
"" : {

},
"…and all the awesome open source contributors on GitHub!" : {
"comment" : "End of credits in about tab"
},
"%" : {

Expand Down Expand Up @@ -2057,6 +2054,9 @@
}
}
}
},
"Some features, ideas, and bug fixes" : {

},
"Stage Manager" : {
"localizations" : {
Expand Down
45 changes: 27 additions & 18 deletions Loop/Luminare/Loop/AboutConfigurationView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,38 +21,44 @@ struct AboutConfigurationView: View {
.init(
"Kai",
"Development",
.init(string: "https://github.com/mrkai77")!,
url: .init(string: "https://github.com/mrkai77")!,
avatar: .init(string: "https://github.com/mrkai77.png?size=200")!
),
.init(
"Jace",
"Design",
.init(string: "https://x.com/jacethings")!,
url: .init(string: "https://x.com/jacethings")!,
avatar: .init(string: "https://github.com/soft-bred.png?size=200")!
),
.init(
"Kami",
"Development support",
.init(string: "https://github.com/senpaihunters")!,
url: .init(string: "https://github.com/senpaihunters")!,
avatar: .init(string: "https://github.com/senpaihunters.png?size=200")!
),
.init(
"Greg Lassale",
"Icon contributor",
.init(string: "https://x.com/greglassale")!,
url: .init(string: "https://x.com/greglassale")!,
avatar: .init(string: "https://pbs.twimg.com/profile_images/1746348765127094272/eNO2LxOQ_200x200.jpg")!
),
.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")!
)
]

struct CreditItem: Identifiable {
var id: String { name }

let name: String
let description: LocalizedStringKey
let description: LocalizedStringKey?
let url: URL
let avatar: URL

init(_ name: String, _ description: LocalizedStringKey, _ url: URL, avatar: URL) {
init(_ name: String, _ description: LocalizedStringKey? = nil, url: URL, avatar: URL) {
self.name = name
self.description = description
self.avatar = avatar
Expand Down Expand Up @@ -124,15 +130,15 @@ struct AboutConfigurationView: View {
}
}

Button {
openURL(URL(string: "https://github.com/MrKai77/Loop/graphs/contributors")!)
} label: {
Text("…and all the awesome open source contributors on GitHub!", comment: "End of credits in about tab")
.font(.caption)
.foregroundStyle(.secondary)
}
.padding(.bottom, 4)
.buttonStyle(PlainButtonStyle())
// Button {
// openURL(URL(string: "https://github.com/MrKai77/Loop/graphs/contributors")!)
// } label: {
// Text("…and all the awesome open source contributors on GitHub!", comment: "End of credits in about tab")
// .font(.caption)
// .foregroundStyle(.secondary)
// }
// .padding(.bottom, 4)
// .buttonStyle(PlainButtonStyle())
}

@ViewBuilder
Expand Down Expand Up @@ -160,9 +166,12 @@ struct AboutConfigurationView: View {

VStack(alignment: .leading) {
Text(credit.name)
Text(credit.description)
.font(.caption)
.foregroundStyle(.secondary)

if let description = credit.description {
Text(description)
.font(.caption)
.foregroundStyle(.secondary)
}
}

Spacer()
Expand Down

0 comments on commit 4eb98a0

Please sign in to comment.