Skip to content
This repository has been archived by the owner on Sep 24, 2024. It is now read-only.

feat: 🎸 UI refinements #33

Merged
merged 1 commit into from
Aug 11, 2021
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
3 changes: 2 additions & 1 deletion Sources/SAPCAI/UI/Common/SwiftUI/CardSectionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ struct CardSectionsView: View {
.padding([.leading], 16)
}
}
.frame(minHeight: 44)
}
}
}
Expand Down Expand Up @@ -94,7 +95,7 @@ extension CardSectionsView {
return VStack(alignment: .leading, spacing: 3) {
if secAttribute.label != nil {
Text(secAttribute.label!)
.font(.subheadline)
.font(.body)
.foregroundColor(self.themeManager.color(for: .primary2))
.lineLimit(1)
.padding([.top], 10)
Expand Down
1 change: 1 addition & 0 deletions Sources/SAPCAI/UI/Common/SwiftUI/CarouselItemView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ struct CarouselItemView: View {
}
if carouselItem!.itemButtons != nil {
CarouselButtonsView(buttonsData: carouselItem!.itemButtons)
.frame(minHeight: 44)
}
}
}
Expand Down
11 changes: 11 additions & 0 deletions Sources/SAPCAI/UI/Common/SwiftUI/View+Extensions.swift
Original file line number Diff line number Diff line change
Expand Up @@ -60,3 +60,14 @@ struct EdgeBorder: Shape {
return path
}
}

struct RoundedCorner: Shape {
var radius: CGFloat = .infinity
var corners: UIRectCorner = .allCorners

func path(in rect: CGRect) -> Path {
let path = UIBezierPath(roundedRect: rect, byRoundingCorners: corners,
cornerRadii: CGSize(width: radius, height: radius))
return Path(path.cgPath)
}
}
3 changes: 2 additions & 1 deletion Sources/SAPCAI/UI/MessageView/ObjectCardMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ struct ObjectCardMessageView: View {
.frame(width: 50, height: 50)
}
HStack(alignment: .firstTextBaseline) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 6) {
if model.headline != nil {
Text(model.headline!)
.font(.headline)
Expand Down Expand Up @@ -107,6 +107,7 @@ struct ObjectCardMessageView: View {
Divider().background(self.themeManager.color(for: .lineColor))
}
}
.frame(minHeight: 44)
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion Sources/SAPCAI/UI/MessageView/ObjectMessageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ struct ObjectMessageView: View {
.frame(width: 50, height: 50)
}
HStack(alignment: self.hasButtons && !self.hasStatus ? .center : .firstTextBaseline) {
VStack(alignment: .leading) {
VStack(alignment: .leading, spacing: 6) {
if model.headline != nil {
Text(model.headline!)
.font(.headline)
Expand Down
3 changes: 2 additions & 1 deletion Sources/SAPCAI/UI/Modifiers/Modifiers.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ func roundedBorder(for theme: CAITheme) -> some View {
}

func roundedBackground(for theme: CAITheme, key: Theme.Color.Key) -> some View {
RoundedRectangle(cornerRadius: theme.value(for: .cornerRadius, type: CGFloat.self, defaultValue: 8))
RoundedCorner(radius: theme.value(for: .cornerRadius, type: CGFloat.self, defaultValue: 8),
corners: [.topLeft, .topRight, .bottomLeft])
.fill(theme.color(for: key))
}

Expand Down