diff --git a/Shared/views/SmallRollUpHeaderView.swift b/Shared/views/SmallRollUpHeaderView.swift index 23e4cce..d3816fe 100644 --- a/Shared/views/SmallRollUpHeaderView.swift +++ b/Shared/views/SmallRollUpHeaderView.swift @@ -60,7 +60,7 @@ struct SmallRollUpHeaderView: View { } } - private var textViews: some View { + private var modelTextViews: some View { HStack { ForEach(entries, id: \.0) { model in textView(forModel: model) @@ -68,6 +68,31 @@ struct SmallRollUpHeaderView: View { } } + private var viewOnViewtype : some View { + HStack { + switch viewType { + case .total, .percentageCircle: + circularViews + case .percentage: + textViews + } + } + } + + private var textViews: some View { + HStack { + ForEach(entries, id: \.0) { model in + textView(forModel: model) + .font(.title2) + .fontWeight(.bold) + .lineLimit(1) + .foregroundColor(model.mood.color) + .frame(width: 50, height: 50) + } + } + .padding([.top, .bottom]) + } + private var circularViews: some View { HStack { ForEach(entries, id: \.0) { model in @@ -84,22 +109,14 @@ struct SmallRollUpHeaderView: View { .lineLimit(1) .foregroundColor(Color(UIColor.white)) } - .padding([.leading, .trailing], 5) } } + .padding([.top, .bottom]) } var body: some View { - VStack { - circularViews - .padding([.trailing, .leading, .top]) - - Text(String(format: String(localized: "content_view_header_title"), self.backDays)) - .font(.body) - .foregroundColor(Color(UIColor.systemGray)) - .frame(maxWidth: .infinity, alignment: .center) - .padding(.top, 1) - } + viewOnViewtype + .frame(minWidth: 0, maxWidth: .infinity) } }