Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions umd-dining-app/Utilities/UMDColors.swift
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ extension Color {

struct HomeCardStyle: ViewModifier {
var tint: Color
// Secondary cards (gray) wear a lighter outline than the red ones
var thin: Bool = false
@Environment(\.colorScheme) private var colorScheme

func body(content: Content) -> some View {
Expand All @@ -42,7 +44,9 @@ struct HomeCardStyle: ViewModifier {
.clipShape(RoundedRectangle(cornerRadius: 12))
.overlay(RoundedRectangle(cornerRadius: 12).stroke(
tint.opacity(colorScheme == .dark ? 0.7 : 0.35),
lineWidth: colorScheme == .dark ? 2 : 1.5
lineWidth: thin
? (colorScheme == .dark ? 1.5 : 1)
: (colorScheme == .dark ? 2 : 1.5)
))
.shadow(color: .black.opacity(colorScheme == .dark ? 0.35 : 0.10), radius: 5, x: 0, y: 2)
}
Expand Down Expand Up @@ -82,8 +86,8 @@ extension View {
}

extension View {
func homeCard(tint: Color = .umdRed) -> some View {
modifier(HomeCardStyle(tint: tint))
func homeCard(tint: Color = .umdRed, thin: Bool = false) -> some View {
modifier(HomeCardStyle(tint: tint, thin: thin))
}
}

Expand Down
4 changes: 2 additions & 2 deletions umd-dining-app/Views/NutritionDetailView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ struct NutritionDetailView: View {
.foregroundStyle(.secondary)
.padding(16)
.frame(maxWidth: .infinity, alignment: .leading)
.homeCard()
.homeCard(tint: .gray, thin: true)
}
.padding(.horizontal, 16)
}
Expand Down Expand Up @@ -407,7 +407,7 @@ struct NutritionDetailView: View {
}
}
}
.homeCard()
.homeCard(tint: .gray, thin: true)
}
.padding(.horizontal, 16)
}
Expand Down
6 changes: 3 additions & 3 deletions umd-dining-app/Views/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ struct ProfileView: View {
}
}
.padding(16)
.homeCard(tint: .gray)
.homeCard(tint: .gray, thin: true)
.padding(.horizontal, 16)
.padding(.top, 8)
.padding(.bottom, 20)
Expand Down Expand Up @@ -235,7 +235,7 @@ struct ProfileView: View {
) -> some View {
Button(action: action) {
content()
.homeCard(tint: .gray)
.homeCard(tint: .gray, thin: true)
}
.buttonStyle(PressableButtonStyle())
}
Expand All @@ -258,7 +258,7 @@ struct ProfileView: View {
}
.padding(.horizontal, 16)
.padding(.vertical, 16)
.homeCard(tint: .gray)
.homeCard(tint: .gray, thin: true)
}

// MARK: - Header
Expand Down
Loading