Skip to content

Commit

Permalink
fix(onboarding): move attributed title declaration out of view body
Browse files Browse the repository at this point in the history
  • Loading branch information
cryptoAlgorithm committed Jul 1, 2023
1 parent 952ddb9 commit e6f8bde
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
"location" : "https://github.com/SwiftcordApp/DiscordKit",
"state" : {
"branch" : "main",
"revision" : "1ebdca903f96966fb54ac41a2b1d04b0f5845a9b"
"revision" : "1474f71dabb18050cc2422d08643731b7aecf6a4"
}
},
{
Expand Down
24 changes: 12 additions & 12 deletions Swiftcord/Views/OnboardingView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,22 @@ struct OnboardingWelcomeView: View {
let loadingNew: Bool
let hasNew: Bool

var body: some View {
VStack(alignment: .leading, spacing: 16) {
Group {
var attributedTitle: AttributedString {
var attributedString: AttributedString = .init(localized: "onboarding.title \(appName ?? "")")
var attributedTitle: AttributedString {
var attributedString: AttributedString = .init(localized: "onboarding.title \(appName ?? "")")

let appNameRange = attributedString.range(of: appName ?? "")
let appNameRange = attributedString.range(of: appName ?? "")

if let appNameRange = appNameRange {
attributedString[appNameRange].foregroundColor = .accentColor
attributedString[appNameRange].font = .system(size: 72).weight(.heavy)
}
if let appNameRange = appNameRange {
attributedString[appNameRange].foregroundColor = .accentColor
attributedString[appNameRange].font = .system(size: 72).weight(.heavy)
}

return attributedString
}
return attributedString
}

var body: some View {
VStack(alignment: .leading, spacing: 16) {
Group {
Text(attributedTitle)
.font(.largeTitle)

Expand Down

0 comments on commit e6f8bde

Please sign in to comment.