Skip to content
Draft
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
60 changes: 56 additions & 4 deletions TechMarketplace.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,13 @@
316EA1C52A9B2BD800343D67 /* SignupView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316EA1C42A9B2BD800343D67 /* SignupView.swift */; };
316EA1C82A9B3C8900343D67 /* LabelTextField.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316EA1C72A9B3C8900343D67 /* LabelTextField.swift */; };
316EA1CA2A9B3EE100343D67 /* CustomTextFieldStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 316EA1C92A9B3EE100343D67 /* CustomTextFieldStyle.swift */; };
31CE4C572A9BCCAB00EA72FB /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C562A9BCCAB00EA72FB /* HomeView.swift */; };
31CE4C592A9BD89C00EA72FB /* SaleText.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C582A9BD89C00EA72FB /* SaleText.swift */; };
31CE4C5B2A9BD96A00EA72FB /* HomeBanner.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C5A2A9BD96A00EA72FB /* HomeBanner.swift */; };
31CE4C5D2A9BDB6B00EA72FB /* ProductCard.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C5C2A9BDB6B00EA72FB /* ProductCard.swift */; };
31CE4C622A9BDE8600EA72FB /* ProfileView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C612A9BDE8600EA72FB /* ProfileView.swift */; };
31CE4C642A9BDEC000EA72FB /* CartView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C632A9BDEC000EA72FB /* CartView.swift */; };
31CE4C662A9BDED800EA72FB /* SearchView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31CE4C652A9BDED800EA72FB /* SearchView.swift */; };
31F023802A9A0CCA0068636A /* TechMarketplaceApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F0237F2A9A0CCA0068636A /* TechMarketplaceApp.swift */; };
31F023822A9A0CCA0068636A /* OnboardingView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F023812A9A0CCA0068636A /* OnboardingView.swift */; };
31F023842A9A0CCB0068636A /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 31F023832A9A0CCB0068636A /* Assets.xcassets */; };
Expand All @@ -21,7 +28,7 @@
31F023A02A9A0CCB0068636A /* TechMarketplaceUITests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F0239F2A9A0CCB0068636A /* TechMarketplaceUITests.swift */; };
31F023A22A9A0CCB0068636A /* TechMarketplaceUITestsLaunchTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F023A12A9A0CCB0068636A /* TechMarketplaceUITestsLaunchTests.swift */; };
31F023B12A9A27200068636A /* LoginOptionView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F023B02A9A27200068636A /* LoginOptionView.swift */; };
31F023B42A9A287E0068636A /* HomeView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F023B32A9A287E0068636A /* HomeView.swift */; };
31F023B42A9A287E0068636A /* HomeTabView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F023B32A9A287E0068636A /* HomeTabView.swift */; };
31F023B62A9A3BC80068636A /* ColorTokens.swift in Sources */ = {isa = PBXBuildFile; fileRef = 31F023B52A9A3BC80068636A /* ColorTokens.swift */; };
/* End PBXBuildFile section */

Expand All @@ -47,6 +54,13 @@
316EA1C42A9B2BD800343D67 /* SignupView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SignupView.swift; sourceTree = "<group>"; };
316EA1C72A9B3C8900343D67 /* LabelTextField.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LabelTextField.swift; sourceTree = "<group>"; };
316EA1C92A9B3EE100343D67 /* CustomTextFieldStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomTextFieldStyle.swift; sourceTree = "<group>"; };
31CE4C562A9BCCAB00EA72FB /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
31CE4C582A9BD89C00EA72FB /* SaleText.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SaleText.swift; sourceTree = "<group>"; };
31CE4C5A2A9BD96A00EA72FB /* HomeBanner.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeBanner.swift; sourceTree = "<group>"; };
31CE4C5C2A9BDB6B00EA72FB /* ProductCard.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProductCard.swift; sourceTree = "<group>"; };
31CE4C612A9BDE8600EA72FB /* ProfileView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ProfileView.swift; sourceTree = "<group>"; };
31CE4C632A9BDEC000EA72FB /* CartView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CartView.swift; sourceTree = "<group>"; };
31CE4C652A9BDED800EA72FB /* SearchView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = SearchView.swift; sourceTree = "<group>"; };
31F0237C2A9A0CCA0068636A /* TechMarketplace.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = TechMarketplace.app; sourceTree = BUILT_PRODUCTS_DIR; };
31F0237F2A9A0CCA0068636A /* TechMarketplaceApp.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TechMarketplaceApp.swift; sourceTree = "<group>"; };
31F023812A9A0CCA0068636A /* OnboardingView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = OnboardingView.swift; sourceTree = "<group>"; };
Expand All @@ -60,7 +74,7 @@
31F0239F2A9A0CCB0068636A /* TechMarketplaceUITests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TechMarketplaceUITests.swift; sourceTree = "<group>"; };
31F023A12A9A0CCB0068636A /* TechMarketplaceUITestsLaunchTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = TechMarketplaceUITestsLaunchTests.swift; sourceTree = "<group>"; };
31F023B02A9A27200068636A /* LoginOptionView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LoginOptionView.swift; sourceTree = "<group>"; };
31F023B32A9A287E0068636A /* HomeView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeView.swift; sourceTree = "<group>"; };
31F023B32A9A287E0068636A /* HomeTabView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = HomeTabView.swift; sourceTree = "<group>"; };
31F023B52A9A3BC80068636A /* ColorTokens.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ColorTokens.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

Expand Down Expand Up @@ -106,6 +120,30 @@
path = SharedUI;
sourceTree = "<group>";
};
31CE4C5E2A9BDE7300EA72FB /* Search */ = {
isa = PBXGroup;
children = (
31CE4C652A9BDED800EA72FB /* SearchView.swift */,
);
path = Search;
sourceTree = "<group>";
};
31CE4C5F2A9BDE7800EA72FB /* Cart */ = {
isa = PBXGroup;
children = (
31CE4C632A9BDEC000EA72FB /* CartView.swift */,
);
path = Cart;
sourceTree = "<group>";
};
31CE4C602A9BDE7E00EA72FB /* Profile */ = {
isa = PBXGroup;
children = (
31CE4C612A9BDE8600EA72FB /* ProfileView.swift */,
);
path = Profile;
sourceTree = "<group>";
};
31F023732A9A0CCA0068636A = {
isa = PBXGroup;
children = (
Expand All @@ -129,6 +167,9 @@
31F0237E2A9A0CCA0068636A /* TechMarketplace */ = {
isa = PBXGroup;
children = (
31CE4C602A9BDE7E00EA72FB /* Profile */,
31CE4C5F2A9BDE7800EA72FB /* Cart */,
31CE4C5E2A9BDE7300EA72FB /* Search */,
316EA1C62A9B3C7600343D67 /* SharedUI */,
316EA1C32A9B2BC900343D67 /* Signup */,
31F023B22A9A28750068636A /* Home */,
Expand Down Expand Up @@ -189,7 +230,11 @@
31F023B22A9A28750068636A /* Home */ = {
isa = PBXGroup;
children = (
31F023B32A9A287E0068636A /* HomeView.swift */,
31F023B32A9A287E0068636A /* HomeTabView.swift */,
31CE4C562A9BCCAB00EA72FB /* HomeView.swift */,
31CE4C5C2A9BDB6B00EA72FB /* ProductCard.swift */,
31CE4C5A2A9BD96A00EA72FB /* HomeBanner.swift */,
31CE4C582A9BD89C00EA72FB /* SaleText.swift */,
);
path = Home;
sourceTree = "<group>";
Expand Down Expand Up @@ -327,12 +372,19 @@
316EA1C52A9B2BD800343D67 /* SignupView.swift in Sources */,
316EA1CA2A9B3EE100343D67 /* CustomTextFieldStyle.swift in Sources */,
31F023892A9A0CCB0068636A /* Persistence.swift in Sources */,
31CE4C642A9BDEC000EA72FB /* CartView.swift in Sources */,
31CE4C592A9BD89C00EA72FB /* SaleText.swift in Sources */,
31CE4C5B2A9BD96A00EA72FB /* HomeBanner.swift in Sources */,
31F0238C2A9A0CCB0068636A /* TechMarketplace.xcdatamodeld in Sources */,
31F023822A9A0CCA0068636A /* OnboardingView.swift in Sources */,
316EA1C82A9B3C8900343D67 /* LabelTextField.swift in Sources */,
31F023B42A9A287E0068636A /* HomeView.swift in Sources */,
31CE4C622A9BDE8600EA72FB /* ProfileView.swift in Sources */,
31CE4C662A9BDED800EA72FB /* SearchView.swift in Sources */,
31CE4C5D2A9BDB6B00EA72FB /* ProductCard.swift in Sources */,
31F023B42A9A287E0068636A /* HomeTabView.swift in Sources */,
31F023B12A9A27200068636A /* LoginOptionView.swift in Sources */,
316EA1C22A9B236000343D67 /* LoginView.swift in Sources */,
31CE4C572A9BCCAB00EA72FB /* HomeView.swift in Sources */,
31F023802A9A0CCA0068636A /* TechMarketplaceApp.swift in Sources */,
31F023B62A9A3BC80068636A /* ColorTokens.swift in Sources */,
);
Expand Down
22 changes: 22 additions & 0 deletions TechMarketplace/Assets.xcassets/Monitor.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Monitor picture@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Monitor picture@3x.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.
22 changes: 22 additions & 0 deletions TechMarketplace/Assets.xcassets/Smartphone.imageset/Contents.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "Smartphone picture@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "Smartphone picture@3x.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.
20 changes: 20 additions & 0 deletions TechMarketplace/Cart/CartView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
//
// CartView.swift
// TechMarketplace
//
// Created by Rajmani Kushwaha on 28/08/23.
//

import SwiftUI

struct CartView: View {
var body: some View {
Text("cart")
}
}

struct CartView_Previews: PreviewProvider {
static var previews: some View {
CartView()
}
}
3 changes: 2 additions & 1 deletion TechMarketplace/ColorTokens.swift
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ extension Color {
static let background = Color(UIColor(hex: "#244FE9"))
static let facebook = Color(UIColor(hex: "#415A93"))
static let placeholder = Color.white.opacity(0.8)

static let darkBlue = Color(UIColor(hex: "#0001FC"))
static let baseWhite = Color(UIColor(hex: "#FDFEFF"))
}

extension UIColor {
Expand Down
19 changes: 19 additions & 0 deletions TechMarketplace/Home/HomeBanner.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//
// HomeBanner.swift
// TechMarketplace
//
// Created by Rajmani Kushwaha on 28/08/23.
//

import SwiftUI

struct HomeBanner: View {
var body: some View {
HStack{

}
.frame(maxWidth: .infinity, minHeight: 120)
.background(Color.darkBlue)
.cornerRadius(8)
}
}
49 changes: 49 additions & 0 deletions TechMarketplace/Home/HomeTabView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
//
// HomeView.swift
// TechMarketplace
//
// Created by Rajmani Kushwaha on 26/08/23.
//

import SwiftUI

struct HomeTabView: View {

@Binding var isPresented: Bool

var body: some View {

TabView {

HomeView()
.tabItem {
Image(systemName: "house.fill")
}

SearchView()
.tabItem {
Image(systemName: "magnifyingglass")
}

CartView()
.tabItem {
Image(systemName: "cart")
}

ProfileView()
.tabItem {
Image(systemName: "person")
}
}
}
}

struct HomeTabView_Previews: PreviewProvider {
static var previews: some View {
let binding = Binding<Bool>(
get: { false },
set: { _ in }
)
HomeTabView(isPresented: binding)
}
}
62 changes: 52 additions & 10 deletions TechMarketplace/Home/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,70 @@
// HomeView.swift
// TechMarketplace
//
// Created by Rajmani Kushwaha on 26/08/23.
// Created by Rajmani Kushwaha on 27/08/23.
//

import SwiftUI

struct HomeView: View {

@Binding var isPresented: Bool
var body: some View {
NavigationStack {
ZStack {
Color.baseWhite.edgesIgnoringSafeArea(.all)

VStack {
HomeBanner()

HStack {
CategoryView(title: "Categories")
CategoryView(title: "Favorites")
CategoryView(title: "Gifts")
CategoryView(title: "Best selling")
}
.frame(maxWidth: .infinity, minHeight: 120, maxHeight: 120)
.padding(.top)

Text("Sales")
.bold()
.font(.title)
.padding(.top)

HStack(spacing: 20) {
ProductCard(productName: "Smartphones", productImage: "Smartphone", discount: 20)
ProductCard(productName: "Monitors", productImage: "Monitor", discount: 50)
}
.padding(.top)
}
.padding()
.navigationTitle("Home")
}
}
}
}

struct CategoryView: View {
let title: String

var body: some View {
Button("logout") {
isPresented = false
VStack {
ZStack {
RoundedRectangle(cornerRadius: 20)
.fill(Color.gray) // Assuming you have an extension for light blue color
.frame(width: 40, height: 40)

Image(systemName: "photo")
.resizable()
.aspectRatio(contentMode: .fit)
.frame(width: 20, height: 20)
.foregroundColor(.white)
}
Text(title)
}
}
}

struct HomeView_Previews: PreviewProvider {
static var previews: some View {
let binding = Binding<Bool>(
get: { false },
set: { _ in }
)
HomeView(isPresented: binding)
HomeView()
}
}
40 changes: 40 additions & 0 deletions TechMarketplace/Home/ProductCard.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// ProductCard.swift
// TechMarketplace
//
// Created by Rajmani Kushwaha on 28/08/23.
//

import SwiftUI

struct ProductCard: View {

let productName: String
let productImage: String
let discount: Int

var body: some View {

HStack(spacing: 20) {
VStack {
SaleText(text: "\(discount)")

VStack {
Image(productImage)
Spacer(minLength: 8)
Text(productName)
.fontWeight(.semibold)
.minimumScaleFactor(0.5)
.lineLimit(1)
}
.frame(maxHeight: .infinity)
.padding()
}
.frame(maxWidth: .infinity, maxHeight: .infinity)
.padding()
.background(.white)
.cornerRadius(8)
.shadow(color: .black.opacity(0.15), radius: 4)
}
}
}
Loading