Skip to content
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

Jiwon/profile #80

Merged
merged 18 commits into from
Mar 26, 2025
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
minor changes
JiwonJeong414 committed Mar 16, 2025
commit e3351ae65037562bccfbccbe1676754f954c9dc8
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
}
}
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.
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
}
}
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.
4 changes: 3 additions & 1 deletion Uplift/Utils/Constants.swift
Original file line number Diff line number Diff line change
@@ -108,9 +108,11 @@ struct Constants {
static let cameraMini = Image("camera_mini")
static let clock = Image("clock")
static let cross = Image("cross")
static let dumbbellSolid = Image("dumbbell_solid")
static let dumbbellLarge = Image("dumbbell_large")
static let dumbbellOutline = Image("dumbbell_outline")
static let dumbbellSolid = Image("dumbbell_solid")
static let profileOutline = Image("profile_outline")
static let profileSolid = Image("profile_solid")
static let elevator = Image("elevator")
static let greenTea = Image("green_tea")
static let giveawayModalBackground = Image("giveaway_modal_bg")
2 changes: 1 addition & 1 deletion Uplift/Views/MainView.swift
Original file line number Diff line number Diff line change
@@ -100,7 +100,7 @@ struct MainView: View {
selectedTab = .profile
} label: {
tabItemView(
icon: selectedTab == .profile ? Constants.Images.whistleSolid : Constants.Images.whistleOutline,
icon: selectedTab == .profile ? Constants.Images.profileSolid : Constants.Images.profileOutline,
name: "Profile"
)
}
16 changes: 10 additions & 6 deletions Uplift/Views/ProfileView.swift
Original file line number Diff line number Diff line change
@@ -16,7 +16,7 @@ struct ProfileView: View {
@EnvironmentObject var tabBarProp: TabBarProperty
@StateObject private var viewModel = ViewModel()

// MARK: - UI
// MARK: - UI
var body: some View {
NavigationStack {
VStack {
@@ -186,13 +186,10 @@ struct ProfileView: View {
.padding(.horizontal, Constants.Padding.homeHorizontal)
.padding(.top, 24)
}
.refreshable {
viewModel.fetchUserProfile()
}
}

private var profileTopSection: some View {
HStack(spacing: 24) {
HStack(spacing: 20) {
// Profile image with camera icon
ZStack(alignment: .bottomTrailing) {
ZStack {
@@ -236,7 +233,7 @@ struct ProfileView: View {
.font(Constants.Fonts.h1)
.foregroundStyle(Constants.Colors.black)

HStack(spacing: 46.5) {
HStack(spacing: 24) {
VStack(alignment: .leading, spacing: 4) {
Text("\(viewModel.totalWorkouts)")
.font(Constants.Fonts.h2)
@@ -245,7 +242,9 @@ struct ProfileView: View {
Text("Gym Days")
.font(Constants.Fonts.labelMedium)
.foregroundStyle(Constants.Colors.gray04)
.fixedSize(horizontal: false, vertical: true)
}
.frame(minWidth: 70, alignment: .leading)

VStack(alignment: .leading, spacing: 4) {
Text("\(viewModel.streaks)")
@@ -256,6 +255,7 @@ struct ProfileView: View {
.font(Constants.Fonts.labelMedium)
.foregroundStyle(Constants.Colors.gray04)
}
.frame(minWidth: 55, alignment: .leading)

VStack(alignment: .leading, spacing: 4) {
Text("\(viewModel.badges)")
@@ -266,9 +266,13 @@ struct ProfileView: View {
.font(Constants.Fonts.labelMedium)
.foregroundStyle(Constants.Colors.gray04)
}
.frame(minWidth: 55, alignment: .leading)
}
}

Spacer(minLength: 0)
}
.padding(.horizontal, 2)
}

private var goalView: some View {
4 changes: 3 additions & 1 deletion Uplift/Views/WorkoutProgressArc.swift
Original file line number Diff line number Diff line change
@@ -11,14 +11,16 @@ import SwiftUI
// Unit Circle Animation
struct WorkoutProgressArc: View {
@State private var arcProgress: Double = 0
@State private var dotRotation: Double = 0 // Start at left side (0 degrees bc of Unit Circle)
@State private var dotRotation: Double = 0

@ObservedObject var viewModel: ProfileView.ViewModel

let completedWorkouts: Int = 3
let targetWorkouts: Int = 5
let radius: CGFloat = 126

// I'm in the thicc of it everybody knows

var body: some View {
ZStack {
// Background track