spacing on shapes and text

This commit is contained in:
Trey t
2022-03-20 14:43:25 -05:00
parent 36a688084c
commit e226437e50
5 changed files with 79 additions and 39 deletions

View File

@@ -40,31 +40,38 @@ struct SwitchableView: View {
self._viewType = viewType
}
private var mainViews: some View {
switch viewType {
case .total:
return AnyView(
HeaderStatsView(fakeData: false, backDays: daysBack, moodTint: [
moodTint.color(forMood: .great),
moodTint.color(forMood: .good),
moodTint.color(forMood: .average),
moodTint.color(forMood: .bad),
moodTint.color(forMood: .horrible)
], textColor: textColor))
.allowsHitTesting(false)
case .percentageShape:
return AnyView(
HeaderPercView(fakeData: false, backDays: daysBack, type: .shape))
.allowsHitTesting(false)
case .percentage:
return AnyView(
HeaderPercView(fakeData: false, backDays: daysBack, type: .text))
.allowsHitTesting(false)
}
}
var body: some View {
VStack {
ZStack {
Text(String(customMoodTintUpdateNumber))
.hidden()
switch viewType {
case .total:
HeaderStatsView(fakeData: false, backDays: daysBack, moodTint: [
moodTint.color(forMood: .great),
moodTint.color(forMood: .good),
moodTint.color(forMood: .average),
moodTint.color(forMood: .bad),
moodTint.color(forMood: .horrible)
], textColor: textColor)
.padding([.leading, .trailing], -15)
.padding([.top, .bottom], 8)
.allowsHitTesting(false)
case .percentageShape:
HeaderPercView(fakeData: false, backDays: daysBack, type: .circular)
.allowsHitTesting(false)
case .percentage:
HeaderPercView(fakeData: false, backDays: daysBack, type: .text)
.allowsHitTesting(false)
}
.hidden()
mainViews
.padding(.top)
VStack {
HStack {
Spacer()