Skip to content

Commit

Permalink
BAL-175-GP-BodySensations-Coins-Rewards
Browse files Browse the repository at this point in the history
  • Loading branch information
gperissetcelteeka committed Sep 1, 2023
1 parent 2f39135 commit 4586216
Show file tree
Hide file tree
Showing 3 changed files with 75 additions and 4 deletions.
4 changes: 4 additions & 0 deletions Balance.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,7 @@
6CC177282A3A6BA900121B72 /* CellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CC177272A3A6BA900121B72 /* CellView.swift */; };
6CE62D552A014BF300BB4F90 /* LaunchScreen.storyboard in Resources */ = {isa = PBXBuildFile; fileRef = 6CE62D542A014BF300BB4F90 /* LaunchScreen.storyboard */; };
6CE62D572A028F3400BB4F90 /* Country.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE62D562A028F3400BB4F90 /* Country.swift */; };
6CE8A7892AA291A4003CD727 /* ChillCellView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CE8A7882AA291A4003CD727 /* ChillCellView.swift */; };
6CF510C029C8FD25008A2F55 /* LocationView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF510BF29C8FD25008A2F55 /* LocationView.swift */; };
6CF6BEE62A31103A00A337F3 /* Bundle+Image.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF6BEE12A31103A00A337F3 /* Bundle+Image.swift */; };
6CF6BEE72A31103A00A337F3 /* FeatureFlags.swift in Sources */ = {isa = PBXBuildFile; fileRef = 6CF6BEE22A31103A00A337F3 /* FeatureFlags.swift */; };
Expand Down Expand Up @@ -358,6 +359,7 @@
6CC177272A3A6BA900121B72 /* CellView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CellView.swift; sourceTree = "<group>"; };
6CE62D542A014BF300BB4F90 /* LaunchScreen.storyboard */ = {isa = PBXFileReference; lastKnownFileType = file.storyboard; path = LaunchScreen.storyboard; sourceTree = "<group>"; };
6CE62D562A028F3400BB4F90 /* Country.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Country.swift; sourceTree = "<group>"; };
6CE8A7882AA291A4003CD727 /* ChillCellView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; name = ChillCellView.swift; path = Balance/Chill/ChillCellView.swift; sourceTree = SOURCE_ROOT; };
6CF510BF29C8FD25008A2F55 /* LocationView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = LocationView.swift; sourceTree = "<group>"; };
6CF6BEE12A31103A00A337F3 /* Bundle+Image.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Bundle+Image.swift"; sourceTree = "<group>"; };
6CF6BEE22A31103A00A337F3 /* FeatureFlags.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FeatureFlags.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -797,6 +799,7 @@
children = (
4ACC786029AC0B590048D1D1 /* Meditation */,
6C370AAC29D38F7F001781B3 /* ChillView.swift */,
6CE8A7882AA291A4003CD727 /* ChillCellView.swift */,
6CE62D5D2A030B6800BB4F90 /* Timer */,
6C85C6DD2A0554610053F759 /* BodySensationView.swift */,
);
Expand Down Expand Up @@ -1213,6 +1216,7 @@
6C55770F2A3A505F003FD6EE /* SpotifyDataController.swift in Sources */,
6CB5181A29E45678007AADB4 /* ImageCollectionView.swift in Sources */,
6C3248482A8D85AB00223F8C /* SketchView.swift in Sources */,
6CE8A7892AA291A4003CD727 /* ChillCellView.swift in Sources */,
6C55243829F8722B00F802D9 /* ContentView.swift in Sources */,
6CC177262A3A5E2900121B72 /* ActivityLogStore.swift in Sources */,
89EB7BB129B45D2B000470FC /* HeaderMenu.swift in Sources */,
Expand Down
67 changes: 67 additions & 0 deletions Balance/Chill/ChillCellView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
//
// This source file is part of the CS342 2023 Balance Team Application project
//
// SPDX-FileCopyrightText: 2023 Stanford University
//
// SPDX-License-Identifier: MIT
//

import SwiftUI

struct ChillCellView: View {
var image: String
var text: String
var pointVal: String

var body: some View {
HStack {
Image(image)
.resizable()
.scaledToFit()
.accessibility(hidden: true)
.frame(width: 80, height: 80)
Spacer()
Text(text)
.padding(.leading, 20.0)
.minimumScaleFactor(0.5)
.font(.custom("Nunito-Bold", size: 25))
.lineLimit(2)
.multilineTextAlignment(.leading)
.frame(maxWidth: .infinity, alignment: .leading)
.frame(height: 80)
Spacer()
VStack {
pointValueView
Spacer()
}
}
.padding(EdgeInsets(top: 24, leading: 24, bottom: 24, trailing: 0))
.frame(maxWidth: 311, maxHeight: 114)
.foregroundColor(darkBlueColor)
.background(RoundedRectangle(cornerRadius: 20).fill(.white))
.clipped()
.shadow(color: Color.black.opacity(0.10), radius: 7, x: 2, y: 2)
.padding(EdgeInsets(top: 0, leading: 24, bottom: 0, trailing: 24))
}

Check warning on line 45 in Balance/Chill/ChillCellView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillCellView.swift#L16-L45

Added lines #L16 - L45 were not covered by tests

var pointValueView: some View {
ZStack {
Text(pointVal)
.font(.custom("Nunito-Bold", size: 14))
.frame(width: 30, height: 20)
.padding(.trailing, 25.0)
.padding(.vertical, 3.0)
.background(primaryColor .opacity(0.4))
.cornerRadius(5)
.offset(x: -10)
Image("pointsStarIcon")
.accessibility(hidden: true)
}.offset(y: -15)
}

Check warning on line 60 in Balance/Chill/ChillCellView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillCellView.swift#L47-L60

Added lines #L47 - L60 were not covered by tests
}

struct ChillCellViewPreview: PreviewProvider {
static var previews: some View {
ChillCellView(image: "BalanceLogo", text: "diary", pointVal: "5")
}

Check warning on line 66 in Balance/Chill/ChillCellView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillCellView.swift#L64-L66

Added lines #L64 - L66 were not covered by tests
}
8 changes: 4 additions & 4 deletions Balance/Chill/ChillView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "writeIcon", text: "Write Something")
ChillCellView(image: "writeIcon", text: "Write Something", pointVal: "5")

Check warning on line 51 in Balance/Chill/ChillView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillView.swift#L51

Added line #L51 was not covered by tests
}
}

Expand All @@ -62,7 +62,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "meditationIcon", text: "Guided Meditation")
ChillCellView(image: "meditationIcon", text: "Guided Meditation", pointVal: "5")

Check warning on line 65 in Balance/Chill/ChillView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillView.swift#L65

Added line #L65 was not covered by tests
}
}

Expand All @@ -76,7 +76,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "breathIcon", text: "Breathing")
ChillCellView(image: "breathIcon", text: "Breathing", pointVal: "5")

Check warning on line 79 in Balance/Chill/ChillView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillView.swift#L79

Added line #L79 was not covered by tests
}
}

Expand All @@ -90,7 +90,7 @@ struct ChillView: View {
}
)
) {
NavView(image: "bodySensationIcon", text: "Body Sensations")
ChillCellView(image: "bodySensationIcon", text: "Body Sensations", pointVal: "5")

Check warning on line 93 in Balance/Chill/ChillView.swift

View check run for this annotation

Codecov / codecov/patch

Balance/Chill/ChillView.swift#L93

Added line #L93 was not covered by tests
}
}
}
Expand Down

0 comments on commit 4586216

Please sign in to comment.