Refactor LicensesView to use SettingsCard from Bedrock

This commit is contained in:
Matt Bruce 2026-01-04 18:12:47 -06:00
parent 845367fa87
commit 44512e923c

View File

@ -38,33 +38,33 @@ struct LicensesView: View {
} }
private func licenseCard(name: String, url: String, license: String, description: String) -> some View { private func licenseCard(name: String, url: String, license: String, description: String) -> some View {
VStack(alignment: .leading, spacing: Design.Spacing.small) { SettingsCard(backgroundColor: AppSurface.card, borderColor: AppBorder.subtle) {
Text(name) VStack(alignment: .leading, spacing: Design.Spacing.small) {
.font(.system(size: Design.BaseFontSize.medium, weight: .bold)) Text(name)
.foregroundStyle(.white) .font(.system(size: Design.BaseFontSize.medium, weight: .bold))
.foregroundStyle(.white)
Text(description) Text(description)
.font(.system(size: Design.BaseFontSize.caption)) .font(.system(size: Design.BaseFontSize.caption))
.foregroundStyle(.white.opacity(Design.Opacity.strong)) .foregroundStyle(.white.opacity(Design.Opacity.strong))
HStack { HStack {
Label(license, systemImage: "doc.text") Label(license, systemImage: "doc.text")
.font(.system(size: Design.BaseFontSize.xSmall)) .font(.system(size: Design.BaseFontSize.xSmall))
.foregroundStyle(AppAccent.primary) .foregroundStyle(AppAccent.primary)
Spacer() Spacer()
if let linkURL = URL(string: url) { if let linkURL = URL(string: url) {
Link(destination: linkURL) { Link(destination: linkURL) {
Label(String(localized: "View on GitHub"), systemImage: "arrow.up.right.square") Label(String(localized: "View on GitHub"), systemImage: "arrow.up.right.square")
.font(.system(size: Design.BaseFontSize.xSmall)) .font(.system(size: Design.BaseFontSize.xSmall))
.foregroundStyle(AppAccent.primary) .foregroundStyle(AppAccent.primary)
}
} }
} }
.padding(.top, Design.Spacing.xSmall)
} }
.padding(.top, Design.Spacing.xSmall)
} }
.padding(Design.Spacing.medium)
.background(AppSurface.primary, in: RoundedRectangle(cornerRadius: Design.CornerRadius.medium))
} }
} }