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

Dev #5

Open
wants to merge 24 commits into
base: main
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
9c90d0c
Readme Added
smdthiranjaya Mar 16, 2024
866a64d
StartupViewController done.
smdthiranjaya Mar 20, 2024
4a7163e
Clean so unused packges
smdthiranjaya Mar 20, 2024
a9def01
Clean
smdthiranjaya Mar 20, 2024
cf83917
Clean
smdthiranjaya Mar 20, 2024
57ba6db
Branch Clean
smdthiranjaya Mar 20, 2024
a93ce07
Clean initial commit.
smdthiranjaya Mar 20, 2024
48cf11b
Display add products from the database.
smdthiranjaya Mar 22, 2024
8f8c8db
ProductDetailView screen colour, size, qty display added.
smdthiranjaya Mar 22, 2024
60c3e8a
Cart-view created with cartviewmodel.
smdthiranjaya Mar 23, 2024
81e061f
Checkout Initial screen and model setup done.
smdthiranjaya Mar 23, 2024
08b7af4
Product View updated.
smdthiranjaya Mar 26, 2024
d1dced6
Checkout oder place screen done.
smdthiranjaya Mar 27, 2024
47218aa
Profile Screen and Model created.
smdthiranjaya Mar 27, 2024
d4e6171
Profile view changed with new UI.
smdthiranjaya Mar 28, 2024
0a59b64
Home screen UI updated. Special offer section added.
smdthiranjaya Mar 28, 2024
34b0a2d
Remove some debug prints.
smdthiranjaya Mar 28, 2024
fd4d554
Startup screen UI revamped.
smdthiranjaya Mar 29, 2024
557287e
Order model created. Checkout screen updated.
smdthiranjaya Mar 29, 2024
7a2cfde
Some alert boxes added.
smdthiranjaya Mar 29, 2024
460374b
UI updated in cart and login.
smdthiranjaya Mar 30, 2024
87a73db
Add separate config file for add ServerBaseUrl easy use.
smdthiranjaya Mar 30, 2024
ffda5e7
User registration bug fixed.
smdthiranjaya Mar 31, 2024
c7f5680
Restructured user model.
smdthiranjaya Mar 31, 2024
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
Clean so unused packges
smdthiranjaya committed Mar 20, 2024
commit 4a7163e4dadeae07d42232fcb1dd973fd1664e30
4 changes: 0 additions & 4 deletions Vogue Vista.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
@@ -12,7 +12,6 @@
1B1D29C12BA9BC06003A5AC6 /* LoginViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B1D29C02BA9BC06003A5AC6 /* LoginViewController.swift */; };
1B1D29C32BA9BE73003A5AC6 /* UIViewControllerRepresentable.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B1D29C22BA9BE72003A5AC6 /* UIViewControllerRepresentable.swift */; };
1B1D29C62BA9E167003A5AC6 /* File.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B1D29C42BA9C04D003A5AC6 /* File.swift */; };
1B3778802BA42ED20037B375 /* Auth0.plist in Resources */ = {isa = PBXBuildFile; fileRef = 1B37787F2BA42ED10037B375 /* Auth0.plist */; };
1B3778822BA433E20037B375 /* home.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1B3778812BA433E20037B375 /* home.swift */; };
1BD6DB0C2BA23A5F00E42988 /* Vogue_VistaApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 1BD6DB0B2BA23A5F00E42988 /* Vogue_VistaApp.swift */; };
1BD6DB102BA23A6100E42988 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 1BD6DB0F2BA23A6100E42988 /* Assets.xcassets */; };
@@ -44,7 +43,6 @@
1B1D29C02BA9BC06003A5AC6 /* LoginViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginViewController.swift; sourceTree = "<group>"; };
1B1D29C22BA9BE72003A5AC6 /* UIViewControllerRepresentable.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UIViewControllerRepresentable.swift; sourceTree = "<group>"; };
1B1D29C42BA9C04D003A5AC6 /* File.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = File.swift; sourceTree = "<group>"; };
1B37787F2BA42ED10037B375 /* Auth0.plist */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text.plist.xml; path = Auth0.plist; sourceTree = "<group>"; };
1B3778812BA433E20037B375 /* home.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = home.swift; sourceTree = "<group>"; };
1BD6DB082BA23A5F00E42988 /* Vogue Vista.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = "Vogue Vista.app"; sourceTree = BUILT_PRODUCTS_DIR; };
1BD6DB0B2BA23A5F00E42988 /* Vogue_VistaApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Vogue_VistaApp.swift; sourceTree = "<group>"; };
@@ -113,7 +111,6 @@
1BD6DB0A2BA23A5F00E42988 /* Vogue Vista */ = {
isa = PBXGroup;
children = (
1B37787F2BA42ED10037B375 /* Auth0.plist */,
1BD6DB0B2BA23A5F00E42988 /* Vogue_VistaApp.swift */,
1B1D29C22BA9BE72003A5AC6 /* UIViewControllerRepresentable.swift */,
1B1D29BC2BA9BBB0003A5AC6 /* StartupPageViewController.swift */,
@@ -274,7 +271,6 @@
1BD6DB142BA23A6100E42988 /* Preview Assets.xcassets in Resources */,
1BD6DB492BA2416900E42988 /* Localizable.strings in Resources */,
1BD6DB102BA23A6100E42988 /* Assets.xcassets in Resources */,
1B3778802BA42ED20037B375 /* Auth0.plist in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -28,7 +28,7 @@
<key>Vogue Vista.xcscheme_^#shared#^_</key>
<dict>
<key>orderHint</key>
<integer>5</integer>
<integer>0</integer>
</dict>
</dict>
</dict>
10 changes: 0 additions & 10 deletions Vogue Vista/Auth0.plist

This file was deleted.

3 changes: 1 addition & 2 deletions Vogue Vista/Screens/LoginViewController.swift
Original file line number Diff line number Diff line change
@@ -67,7 +67,7 @@ class LoginViewController: UIViewController {
// Login was successful
UserDefaults.standard.set(loginResponse.token, forKey: "userToken")
self?.showAlert(with: "Login Success", message: "You're now logged in!")
// self?.switchToHomeView()
self?.switchToHomeView()
} else {
// Handle unexpected error
self?.showAlert(with: "Login Error", message: "An unknown error occurred.")
@@ -79,7 +79,6 @@ class LoginViewController: UIViewController {
private func showAlert(with title: String, message: String, completion: (() -> Void)? = nil) {
let alert = UIAlertController(title: title, message: message, preferredStyle: .alert)
alert.addAction(UIAlertAction(title: "OK", style: .default) { _ in
self.switchToHomeView()
completion?() // Call the completion handler if it exists
})
present(alert, animated: true)
52 changes: 50 additions & 2 deletions Vogue Vista/Screens/home.swift
Original file line number Diff line number Diff line change
@@ -1,8 +1,56 @@
import SwiftUI

struct HomeView: View {
@State private var showingAlert = false
@State private var navigateToLogin = false

var body: some View {
Text("Welcome to the Home Screen!")
.navigationBarTitle("Home", displayMode: .large)
NavigationView {
ZStack {
// Background Layer
Color.white.edgesIgnoringSafeArea(.all)
VStack {
Spacer()
Text("Welcome to the Home Screen!")
.font(.title)
.fontWeight(.medium)
.padding()
Spacer()
}
}
.navigationBarTitle(Text("Home"), displayMode: .inline)
.navigationBarItems(
leading: HStack {
Button(action: {
print("Profile icon tapped")
}) {
Image(systemName: "person.crop.circle")
.imageScale(.large)
}
},
trailing: HStack {
Button("Log Out") {
showingAlert = true
}
}
)
.alert(isPresented: $showingAlert) {
Alert(
title: Text("Log Out"),
message: Text("Are you sure you want to log out?"),
primaryButton: .destructive(Text("Yes")) {
UserDefaults.standard.removeObject(forKey: "userToken")
navigateToLogin = true

},
secondaryButton: .cancel()
)
}
.fullScreenCover(isPresented: $navigateToLogin) {
StartupPageViewRepresentable()
}
}
}

}