Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
19 changes: 18 additions & 1 deletion Resell/Views/Home/NotificationsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,24 @@ struct NotificationsView: View {
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.background(Constants.Colors.white)
.navigationTitle("Notifications")
.navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button {
router.pop()
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 17, weight: .medium))
.foregroundStyle(Constants.Colors.black)
}
}

ToolbarItem(placement: .principal) {
Text("Notifications")
.font(Constants.Fonts.h3)
.foregroundStyle(Constants.Colors.black)
}
}
.onAppear {
viewModel.fetchNotifications()
}
Expand Down
1 change: 1 addition & 0 deletions Resell/Views/Home/ProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ struct ProfileView: View {
.font(Constants.Fonts.body2)
.foregroundStyle(Constants.Colors.black)
.padding(.bottom, 28)
.padding(.horizontal, 24)
.lineLimit(3)

profileTabsView
Expand Down
18 changes: 12 additions & 6 deletions Resell/Views/NewListing/NewRequestView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ struct NewRequestView: View {
@EnvironmentObject var mainViewModel: MainViewModel
@StateObject private var viewModel = NewRequestViewModel()

@State private var priceFieldPosition: CGFloat = 0.0
@State private var sheetHeight: CGFloat? = nil

// MARK: - UI

Expand All @@ -32,23 +32,22 @@ struct NewRequestView: View {
.preference(key: PriceFieldPositionKey.self, value: geometry.frame(in: .global).maxY)
}
}
.onPreferenceChange(PriceFieldPositionKey.self) { value in
self.priceFieldPosition = value
}

LabeledTextField(label: "Item Description", maxCharacters: 1000, frameHeight: 250, isMultiLine: true, placeholder: "Enter item details... \nCondition \nDimensions", text: $viewModel.descriptionText)

Spacer()

PurpleButton(isLoading: viewModel.isLoading, isActive: viewModel.checkInputIsValid(), text: "Continue") {
viewModel.createNewRequest()
router.pop()
withAnimation {
mainViewModel.hidesTabBar = false
}
}
}
.padding(.horizontal, 24)
}
.padding(.horizontal, 24)
.ignoresSafeArea(.keyboard)
.background(Constants.Colors.white)
.navigationBarBackButtonHidden(true)
.toolbar {
Expand All @@ -73,9 +72,16 @@ struct NewRequestView: View {
}
}
}
.onPreferenceChange(PriceFieldPositionKey.self) { value in
if sheetHeight == nil {
sheetHeight = UIScreen.height - value - (UIScreen.height < 700 ? 0 : 50)
}
}
Comment thread
Alyssa-Wang12 marked this conversation as resolved.
.sheet(isPresented: $viewModel.didShowPriceInput) {
PriceInputView(price: viewModel.isMinText ? $viewModel.priceTextMin : $viewModel.priceTextMax, isPresented: $viewModel.didShowPriceInput, titleText: "What is the \(viewModel.isMinText ? "minimum" : "maximum") of your preferred price range?")
.presentationDetents([.height(UIScreen.height - priceFieldPosition - (UIScreen.height < 700 ? 0 : 50))])
.presentationDetents([
.height(sheetHeight ?? 300)
])
.presentationDragIndicator(.visible)
.presentationCornerRadius(25)
}
Expand Down
10 changes: 9 additions & 1 deletion Resell/Views/ProductDetails/ProductDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -101,9 +101,13 @@ struct ProductDetailsView: View {
.frame(width: 36, height: 24)
.frame(width: 44, height: 44)
.contentShape(Rectangle())
.offset(x: -10)
.font(.system(size: 10, weight: .medium))
.foregroundStyle(Constants.Colors.black)
}
.background(.ultraThinMaterial, in: Circle())
.padding(.leading, 12)

Spacer()

Button {
Expand All @@ -117,8 +121,12 @@ struct ProductDetailsView: View {
.foregroundStyle(Constants.Colors.white)
.frame(width: 44, height: 44)
.contentShape(Rectangle())

Comment thread
Alyssa-Wang12 marked this conversation as resolved.
}
.background(.ultraThinMaterial, in: Circle())
.padding(.trailing, 12)

Comment thread
Alyssa-Wang12 marked this conversation as resolved.

Comment thread
Alyssa-Wang12 marked this conversation as resolved.
}
.padding(.top, topSafeArea * 2 + 4)

Expand Down
10 changes: 10 additions & 0 deletions Resell/Views/Report/ReportDetailsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,17 @@ struct ReportDetailsView: View {
}
.padding(.horizontal, Constants.Spacing.horizontalPadding)
.background(Constants.Colors.white)
.navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button {
router.pop()
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 17, weight: .medium))
.foregroundStyle(Constants.Colors.black)
}
}
Comment thread
Alyssa-Wang12 marked this conversation as resolved.
ToolbarItem(placement: .principal) {
Text("Report \(viewModel.reportType)")
.font(Constants.Fonts.h3)
Expand Down
10 changes: 10 additions & 0 deletions Resell/Views/Report/ReportOptionsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,17 @@ struct ReportOptionsView: View {
Spacer()
}
.background(Constants.Colors.white)
.navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button {
router.pop()
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 17, weight: .medium))
.foregroundStyle(Constants.Colors.black)
}
}
ToolbarItem(placement: .principal) {
Text("Report \(viewModel.reportType)")
.font(Constants.Fonts.h3)
Expand Down
12 changes: 12 additions & 0 deletions Resell/Views/Settings/BlockedUsersView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,25 @@ struct BlockedUsersView: View {
}
.frame(width: UIScreen.width)
.background(Constants.Colors.white)
.navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button {
router.pop()
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 17, weight: .medium))
.foregroundStyle(Constants.Colors.black)
}
}

ToolbarItem(placement: .principal) {
Text("Blocked Users")
.font(Constants.Fonts.h3)
.foregroundStyle(Constants.Colors.black)
}
}

.emptyState(isEmpty: blockedUsers.isEmpty && !isLoading, title: "No blocked users", text: "Users you have blocked will appear here.")
.popupModal(isPresented: $didShowPopup) {
popupModalContent
Expand Down
46 changes: 30 additions & 16 deletions Resell/Views/Settings/EditProfileView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,36 @@ struct EditProfileView: View {
@State private var selectedItem: PhotosPickerItem? = nil
@State private var didShowPhotosPicker: Bool = false

@FocusState private var focusedField: Field?

enum Field {
case username, venmo, bio
}

// MARK: - UI

var body: some View {
VStack {
profileImageView
.padding(.bottom, 40)

nameView

editFieldsView

Spacer()
ScrollViewReader { proxy in
ScrollView {
VStack {
profileImageView
.padding(.bottom, 40)

nameView

editFieldsView

Spacer()
}
}
Comment thread
Alyssa-Wang12 marked this conversation as resolved.
.contentShape(Rectangle())
.onTapGesture {
focusedField = nil
}
.scrollDismissesKeyboard(.immediately)

}
.padding(.top, 40)
.background(Constants.Colors.white)
.toolbar {
ToolbarItem(placement: .principal) {
Text("Edit Profile")
Expand All @@ -59,12 +74,6 @@ struct EditProfileView: View {
.onAppear {
loadCurrentValues()
}
.onChange(of: profileManager.isLoading) { newValue in
if !newValue {
router.popToRoot()
}
}
.endEditingOnTap()
}

private var profileImageView: some View {
Expand Down Expand Up @@ -128,6 +137,7 @@ struct EditProfileView: View {
.foregroundStyle(Constants.Colors.black)

TextField("", text: $editedUsername)
.focused($focusedField, equals: .username)
.font(Constants.Fonts.body1)
.foregroundStyle(Constants.Colors.black)
.multilineTextAlignment(.trailing)
Expand All @@ -143,6 +153,7 @@ struct EditProfileView: View {
.foregroundStyle(Constants.Colors.black)

TextField("", text: $editedVenmo)
.focused($focusedField, equals: .venmo)
.font(Constants.Fonts.body1)
.foregroundStyle(Constants.Colors.black)
.multilineTextAlignment(.trailing)
Expand All @@ -158,6 +169,8 @@ struct EditProfileView: View {
.foregroundStyle(Constants.Colors.black)

TextEditor(text: $editedBio)
.id("bioField")
.focused($focusedField, equals: .bio)
.font(Constants.Fonts.body1)
.foregroundColor(Constants.Colors.black)
.padding(.horizontal, 16)
Expand All @@ -175,6 +188,7 @@ struct EditProfileView: View {
}
.padding(.top, 40)
.padding(.horizontal, Constants.Spacing.horizontalPadding)
.ignoresSafeArea(.keyboard, edges: .bottom)
}

// MARK: - Functions
Expand Down
10 changes: 10 additions & 0 deletions Resell/Views/Settings/SendFeedbackView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,17 @@ struct SendFeedbackView: View {
.padding(.horizontal, Constants.Spacing.horizontalPadding)
.padding(.top, 40)
.background(Constants.Colors.white)
.navigationBarBackButtonHidden(true)
.toolbar {
ToolbarItem(placement: .navigationBarLeading) {
Button {
router.pop()
} label: {
Image(systemName: "chevron.left")
.font(.system(size: 17, weight: .medium))
.foregroundStyle(Constants.Colors.black)
}
}
ToolbarItem(placement: .principal) {
Text("Send Feedback")
.font(Constants.Fonts.h3)
Expand Down
4 changes: 2 additions & 2 deletions Resell/Views/Settings/SettingsView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,15 +46,15 @@ struct SettingsView: View {
router.push(.feedback)
}
case .reviewTesting:
settingsRow(title: "🧪 Test Reviews", icon: "feedback") {
settingsRow(title: "Test Reviews", icon: "feedback") {
Comment thread
Alyssa-Wang12 marked this conversation as resolved.
router.push(.reviewTesting)
}
case .blockedUsers:
settingsRow(title: "Blocked Users", icon: "slash") {
router.push(.blockedUsers)
}
case .eula:
settingsRow(title: "Term and Conditions", icon: "terms") {
settingsRow(title: "Terms and Conditions", icon: "terms") {
viewModel.didShowWebView = true
}
case .logout:
Expand Down