-
Notifications
You must be signed in to change notification settings - Fork 0
Jiwon/profile #80
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Jiwon/profile #80
Changes from all commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
d95cff5
General Profile Layout
JiwonJeong414 002144f
Mock Data + Header
JiwonJeong414 6f60b45
ProgressBar
JiwonJeong414 27c3b36
Animation WorkoutProgressArc
JiwonJeong414 964d03f
ProfileView Layout
JiwonJeong414 89b40cf
Layout Updated
JiwonJeong414 5fe4c30
Edits
JiwonJeong414 e3351ae
minor changes
JiwonJeong414 bdd314a
Edits
JiwonJeong414 873ef75
Clean up Code
JiwonJeong414 c0658ab
Merge branch 'main' of github.com:cuappdev/uplift-ios-swiftui into ji…
JiwonJeong414 76089f0
Addressed Richie's Comments
JiwonJeong414 601f4ff
Padding Bug Fixed
JiwonJeong414 d254617
Renamed Settings
JiwonJeong414 76cb728
Added Space
JiwonJeong414 7fed656
Updated Main View
JiwonJeong414 cff62ca
Addressed Asen's Comments
JiwonJeong414 980504e
Merge branch 'main' into jiwon/profile
JiwonJeong414 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
// | ||
// UserProfile.swift | ||
// Uplift | ||
// | ||
// Created by jiwon jeong on 3/16/25. | ||
// Copyright © 2025 Cornell AppDev. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct UserProfile { | ||
let id: String | ||
let name: String | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// WeeklyWorkoutData.swift | ||
// Uplift | ||
// | ||
// Created by jiwon jeong on 3/16/25. | ||
// Copyright © 2025 Cornell AppDev. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct WeeklyWorkoutData { | ||
var currentWeekWorkouts: Int | ||
var weeklyGoal: Int | ||
var weekDates: [Date] | ||
|
||
var progressPercentage: Double { | ||
Double(currentWeekWorkouts) / Double(weeklyGoal) | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
// | ||
// WorkoutHistory.swift | ||
// Uplift | ||
// | ||
// Created by jiwon jeong on 3/16/25. | ||
// Copyright © 2025 Cornell AppDev. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
struct WorkoutHistory: Identifiable { | ||
let id: String | ||
let location: String | ||
let time: String | ||
let date: String | ||
} |
23 changes: 23 additions & 0 deletions
23
Uplift/Resources/Assets.xcassets/profile_outline.imageset/Contents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Profile.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "Profile 1.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "Profile 2.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.56 KB
Uplift/Resources/Assets.xcassets/profile_outline.imageset/Profile 1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.39 KB
Uplift/Resources/Assets.xcassets/profile_outline.imageset/Profile 2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+760 Bytes
Uplift/Resources/Assets.xcassets/profile_outline.imageset/Profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
Uplift/Resources/Assets.xcassets/profile_solid.imageset/Contents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Profile.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "Profile-2.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "Profile-3.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Binary file added
BIN
+1.36 KB
Uplift/Resources/Assets.xcassets/profile_solid.imageset/Profile-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+2.06 KB
Uplift/Resources/Assets.xcassets/profile_solid.imageset/Profile-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+764 Bytes
Uplift/Resources/Assets.xcassets/profile_solid.imageset/Profile.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
23 changes: 23 additions & 0 deletions
23
Uplift/Resources/Assets.xcassets/settings.imageset/Contents.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
{ | ||
"images" : [ | ||
{ | ||
"filename" : "Settings.png", | ||
"idiom" : "universal", | ||
"scale" : "1x" | ||
}, | ||
{ | ||
"filename" : "Settings 1.png", | ||
"idiom" : "universal", | ||
"scale" : "2x" | ||
}, | ||
{ | ||
"filename" : "Settings 2.png", | ||
"idiom" : "universal", | ||
"scale" : "3x" | ||
} | ||
], | ||
"info" : { | ||
"author" : "xcode", | ||
"version" : 1 | ||
} | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// ProfileViewModel.swift | ||
// Uplift | ||
// | ||
// Created by jiwon jeong on 3/6/25. | ||
// Copyright © 2025 Cornell AppDev. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
|
||
// MARK: - ViewModel | ||
extension ProfileView { | ||
class ViewModel: ObservableObject { | ||
@Published var profile: UserProfile? | ||
@Published var showSettingsSheet = false | ||
@Published var workoutHistory: [WorkoutHistory] = [] | ||
@Published var weeklyWorkouts: WeeklyWorkoutData = WeeklyWorkoutData( | ||
currentWeekWorkouts: 0, | ||
weeklyGoal: 5, | ||
weekDates: [] | ||
) | ||
@Published var totalWorkouts: Int = 0 | ||
@Published var streaks: Int = 14 | ||
@Published var badges: Int = 6 | ||
|
||
/// dummy data | ||
func fetchUserProfile() { | ||
self.profile = DummyData.ProfileViewData.profile | ||
self.totalWorkouts = DummyData.ProfileViewData.totalWorkouts | ||
self.streaks = DummyData.ProfileViewData.streaks | ||
self.badges = DummyData.ProfileViewData.badges | ||
self.weeklyWorkouts = DummyData.ProfileViewData.weeklyWorkouts | ||
self.workoutHistory = DummyData.ProfileViewData.workoutHistory | ||
} | ||
|
||
private func createDate(day: Int) -> Date { | ||
var components = DateComponents() | ||
components.year = 2024 | ||
components.month = 3 | ||
components.day = day | ||
return Calendar.current.date(from: components) ?? Date() | ||
} | ||
} | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.