Skip to content

Commit

Permalink
Add booking screens and improve the readme.
Browse files Browse the repository at this point in the history
  • Loading branch information
imodeveloper committed May 29, 2024
1 parent eb31d01 commit 368d697
Show file tree
Hide file tree
Showing 16 changed files with 948 additions and 22 deletions.
Binary file added Content/Images/barbershop.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 Content/Images/e-commerce.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion DSKit/Sources/DSKit/Modifiers/DSSHadowModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ public struct DSShadowModifier: ViewModifier {
content
.dsPadding(.top, padding)
Rectangle()
.fill(Color.blue)
.fill(appearance.primaryView.background.color)
.frame(maxWidth: .infinity)
.frame(height: 20)
.shadow(color: Color.black.opacity(0.15), radius: 10, x: 0, y: 1)
Expand Down
12 changes: 6 additions & 6 deletions DSKit/Sources/DSKit/Views/DSGrid.swift
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import SwiftUI
Initializes `DSGrid` with customizable settings for layout and data handling.
- Parameters:
- `viewHeight`: Optional height for each item, allowing for uniform or dynamic row heights.
- `numberOfColumns`: The number of columns in the grid, defaulting to 2.
- `columns`: The number of columns in the grid, defaulting to 2.
- `spacing`: Spacing between grid items, with a default setting.
- `data`: The collection of data items to display.
- `id`: KeyPath to the unique identifier for each data item.
Expand All @@ -32,30 +32,30 @@ public struct DSGrid<Data, ID, Content>: View where Data: RandomAccessCollection

let viewHeight: DSDimension?
let spacing: DSSpace
let numberOfColumns: Int
let columns: Int

let data: Data
let content: (Data.Element) -> Content
let id: KeyPath<Data.Element, ID>

public init(
viewHeight: DSDimension? = nil,
numberOfColumns: Int = 2,
columns: Int = 2,
spacing: DSSpace = .regular,
data: Data,
id: KeyPath<Data.Element, ID>,
@ViewBuilder content: @escaping (Data.Element) -> Content
) {
self.viewHeight = viewHeight
self.numberOfColumns = numberOfColumns
self.columns = columns
self.data = data
self.spacing = spacing
self.id = id
self.content = content
}

var layout: [GridItem] {
Array(repeating: GridItem(.flexible(), spacing: appearance.spacing.value(for: self.spacing)), count: numberOfColumns)
Array(repeating: GridItem(.flexible(), spacing: appearance.spacing.value(for: self.spacing)), count: columns)
}

public var body: some View {
Expand All @@ -80,7 +80,7 @@ struct Testable_DSGrid: View {
var body: some View {
DSGrid(
viewHeight: 50,
numberOfColumns: 3,
columns: 3,
data: colors,
id: \.self,
content: { color in
Expand Down
2 changes: 1 addition & 1 deletion DSKit/Sources/DSKit/Views/DSPickerView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ public struct DSPickerView<Data, ID, Content>: View where Data: RandomAccessColl
}

func gridStyle(columns: Int) -> some View {
DSGrid(numberOfColumns: columns, spacing: .regular, data: data, id: id) { element in
DSGrid(columns: columns, spacing: .regular, data: data, id: id) { element in
styledContent(element)
}
}
Expand Down
32 changes: 26 additions & 6 deletions DSKitExplorer.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -171,11 +171,16 @@
60D46A092BCAF16600A6F7FC /* DSKitTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60D46A082BCAF16600A6F7FC /* DSKitTests.swift */; };
60D46A192BCAF25A00A6F7FC /* AssertSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60D46A182BCAF25A00A6F7FC /* AssertSnapshot.swift */; };
60D46A1B2BCAF29600A6F7FC /* AssertSnapshot.swift in Sources */ = {isa = PBXBuildFile; fileRef = 60D46A1A2BCAF29600A6F7FC /* AssertSnapshot.swift */; };
901D2D482C00CA260017DC0C /* BookingScreen3.swift in Sources */ = {isa = PBXBuildFile; fileRef = 901D2D472C00CA260017DC0C /* BookingScreen3.swift */; };
901D2D4A2C0705640017DC0C /* BookingScreen4.swift in Sources */ = {isa = PBXBuildFile; fileRef = 901D2D492C0705640017DC0C /* BookingScreen4.swift */; };
901D2D4C2C070B280017DC0C /* BookingScreen5.swift in Sources */ = {isa = PBXBuildFile; fileRef = 901D2D4B2C070B280017DC0C /* BookingScreen5.swift */; };
90FB4ACE2BFCB1FE008178DF /* DSFuturaFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4ACC2BFCB1FE008178DF /* DSFuturaFont.swift */; };
90FB4AD02BFCDD20008178DF /* DSHelveticaNeueFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4ACF2BFCDD20008178DF /* DSHelveticaNeueFont.swift */; };
90FB4AD22BFCDECD008178DF /* DSVerdanaFont.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4AD12BFCDECD008178DF /* DSVerdanaFont.swift */; };
90FB4AD42BFD2B60008178DF /* ImageGalleryScreen1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4AD32BFD2B60008178DF /* ImageGalleryScreen1.swift */; };
90FB4AD62BFD2FA3008178DF /* ImageGalleryScreen2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4AD52BFD2FA3008178DF /* ImageGalleryScreen2.swift */; };
90FB4AD82BFDE964008178DF /* BookingScreen1.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4AD72BFDE964008178DF /* BookingScreen1.swift */; };
90FB4ADA2BFDFFCB008178DF /* BookingScreen2.swift in Sources */ = {isa = PBXBuildFile; fileRef = 90FB4AD92BFDFFCB008178DF /* BookingScreen2.swift */; };
/* End PBXBuildFile section */

/* Begin PBXContainerItemProxy section */
Expand Down Expand Up @@ -394,11 +399,16 @@
60D46A082BCAF16600A6F7FC /* DSKitTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = DSKitTests.swift; sourceTree = "<group>"; };
60D46A182BCAF25A00A6F7FC /* AssertSnapshot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssertSnapshot.swift; sourceTree = "<group>"; };
60D46A1A2BCAF29600A6F7FC /* AssertSnapshot.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = AssertSnapshot.swift; sourceTree = "<group>"; };
901D2D472C00CA260017DC0C /* BookingScreen3.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookingScreen3.swift; sourceTree = "<group>"; };
901D2D492C0705640017DC0C /* BookingScreen4.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookingScreen4.swift; sourceTree = "<group>"; };
901D2D4B2C070B280017DC0C /* BookingScreen5.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookingScreen5.swift; sourceTree = "<group>"; };
90FB4ACC2BFCB1FE008178DF /* DSFuturaFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DSFuturaFont.swift; sourceTree = "<group>"; };
90FB4ACF2BFCDD20008178DF /* DSHelveticaNeueFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DSHelveticaNeueFont.swift; sourceTree = "<group>"; };
90FB4AD12BFCDECD008178DF /* DSVerdanaFont.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = DSVerdanaFont.swift; sourceTree = "<group>"; };
90FB4AD32BFD2B60008178DF /* ImageGalleryScreen1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageGalleryScreen1.swift; sourceTree = "<group>"; };
90FB4AD52BFD2FA3008178DF /* ImageGalleryScreen2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ImageGalleryScreen2.swift; sourceTree = "<group>"; };
90FB4AD72BFDE964008178DF /* BookingScreen1.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookingScreen1.swift; sourceTree = "<group>"; };
90FB4AD92BFDFFCB008178DF /* BookingScreen2.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = BookingScreen2.swift; sourceTree = "<group>"; };
/* End PBXFileReference section */

/* Begin PBXFrameworksBuildPhase section */
Expand Down Expand Up @@ -642,6 +652,11 @@
children = (
60D469A72BCAF0DC00A6F7FC /* AboutUsScreen1.swift */,
60D469B82BCAF0DC00A6F7FC /* AboutUsScreen2.swift */,
90FB4AD72BFDE964008178DF /* BookingScreen1.swift */,
90FB4AD92BFDFFCB008178DF /* BookingScreen2.swift */,
901D2D472C00CA260017DC0C /* BookingScreen3.swift */,
901D2D492C0705640017DC0C /* BookingScreen4.swift */,
901D2D4B2C070B280017DC0C /* BookingScreen5.swift */,
60D469AC2BCAF0DC00A6F7FC /* CartScreen1.swift */,
60D4699F2BCAF0DC00A6F7FC /* CartScreen2.swift */,
60D469B22BCAF0DC00A6F7FC /* CartScreen3.swift */,
Expand Down Expand Up @@ -1029,6 +1044,7 @@
isa = PBXSourcesBuildPhase;
buildActionMask = 2147483647;
files = (
901D2D4C2C070B280017DC0C /* BookingScreen5.swift in Sources */,
60D469D12BCAF0DC00A6F7FC /* Order1.swift in Sources */,
60D469CB2BCAF0DC00A6F7FC /* Filters2.swift in Sources */,
60D469C22BCAF0DC00A6F7FC /* Items3.swift in Sources */,
Expand All @@ -1039,10 +1055,12 @@
60D469D92BCAF0DC00A6F7FC /* CartScreen2.swift in Sources */,
90FB4AD42BFD2B60008178DF /* ImageGalleryScreen1.swift in Sources */,
60D469F12BCAF0DC00A6F7FC /* ItemDetails1.swift in Sources */,
90FB4ADA2BFDFFCB008178DF /* BookingScreen2.swift in Sources */,
60D469C82BCAF0DC00A6F7FC /* Categories4.swift in Sources */,
608350B52BCC5892002E4F47 /* ScreenView.swift in Sources */,
60D469E02BCAF0DC00A6F7FC /* LogInScreen4.swift in Sources */,
60D469D52BCAF0DC00A6F7FC /* Filters1.swift in Sources */,
90FB4AD82BFDE964008178DF /* BookingScreen1.swift in Sources */,
60D469E42BCAF0DC00A6F7FC /* SignUpScreen4.swift in Sources */,
4185F9142BF38836007483AA /* NewsScreen1.swift in Sources */,
60D469C62BCAF0DC00A6F7FC /* Items5.swift in Sources */,
Expand Down Expand Up @@ -1081,7 +1099,9 @@
60D469D32BCAF0DC00A6F7FC /* Categories5.swift in Sources */,
608350B22BCC565F002E4F47 /* ScreenKey.swift in Sources */,
60D469DF2BCAF0DC00A6F7FC /* ProfileScreen2.swift in Sources */,
901D2D482C00CA260017DC0C /* BookingScreen3.swift in Sources */,
60D469DA2BCAF0DC00A6F7FC /* LogInScreen2.swift in Sources */,
901D2D4A2C0705640017DC0C /* BookingScreen4.swift in Sources */,
60D469E62BCAF0DC00A6F7FC /* CartScreen1.swift in Sources */,
60D469EC2BCAF0DC00A6F7FC /* CartScreen3.swift in Sources */,
60D469C42BCAF0DC00A6F7FC /* Order2.swift in Sources */,
Expand Down Expand Up @@ -1149,7 +1169,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T4R84BG8N8;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -1185,7 +1205,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEFINES_MODULE = YES;
DEVELOPMENT_TEAM = T4R84BG8N8;
DEVELOPMENT_TEAM = "";
DYLIB_COMPATIBILITY_VERSION = 1;
DYLIB_CURRENT_VERSION = 1;
DYLIB_INSTALL_NAME_BASE = "@rpath";
Expand Down Expand Up @@ -1345,7 +1365,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"DSKitExplorer/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 27XPF5QBGW;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand All @@ -1358,7 +1378,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dskit.app.DSKitExplorer;
PRODUCT_BUNDLE_IDENTIFIER = dskit.app.DSKitExplorer.com;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand All @@ -1380,7 +1400,7 @@
CODE_SIGN_STYLE = Automatic;
CURRENT_PROJECT_VERSION = 1;
DEVELOPMENT_ASSET_PATHS = "\"DSKitExplorer/Preview Content\"";
DEVELOPMENT_TEAM = "";
DEVELOPMENT_TEAM = 27XPF5QBGW;
ENABLE_PREVIEWS = YES;
GENERATE_INFOPLIST_FILE = YES;
INFOPLIST_KEY_UIApplicationSceneManifest_Generation = YES;
Expand All @@ -1393,7 +1413,7 @@
"@executable_path/Frameworks",
);
MARKETING_VERSION = 1.0;
PRODUCT_BUNDLE_IDENTIFIER = dskit.app.DSKitExplorer;
PRODUCT_BUNDLE_IDENTIFIER = dskit.app.DSKitExplorer.com;
PRODUCT_NAME = "$(TARGET_NAME)";
PROVISIONING_PROFILE_SPECIFIER = "";
SWIFT_EMIT_LOC_STRINGS = YES;
Expand Down
2 changes: 1 addition & 1 deletion DSKitExplorer/AppearanceSelectionView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ struct AppearanceSelectionView: View {
}
.dsPadding(.top)

DSGrid(numberOfColumns: 2, data: appearances, id: \.title) { appearance in
DSGrid(columns: 2, data: appearances, id: \.title) { appearance in
AppearanceView(appearance: appearance).onTap {
self.selectedAppearance = IdentifiableDesignable(appearance: appearance)
}
Expand Down
18 changes: 14 additions & 4 deletions DSKitExplorer/ScreenKey.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,13 @@
import Foundation

enum ScreenKey: String, CaseIterable, Identifiable {
case ImageGalleryScreen1
case ImageGalleryScreen2
case bookingScreen1
case bookingScreen2
case bookingScreen3
case bookingScreen4
case bookingScreen5
case imageGalleryScreen1
case imageGalleryScreen2
case newsScreen1
case newsScreen2
case filters1
Expand Down Expand Up @@ -122,8 +127,13 @@ enum ScreenKey: String, CaseIterable, Identifiable {
case .aboutUsScreen1: return "About us 1"
case .newsScreen1: return "News Screen 1"
case .newsScreen2: return "News Screen 2"
case .ImageGalleryScreen1: return "Image Screen 1"
case .ImageGalleryScreen2: return "Image Screen 2"
case .imageGalleryScreen1: return "Gallery 1"
case .imageGalleryScreen2: return "Gallery 2"
case .bookingScreen1: return "Booking 1"
case .bookingScreen2: return "Booking 2"
case .bookingScreen3: return "Booking 3"
case .bookingScreen4: return "Booking 4"
case .bookingScreen5: return "Booking 5"
}
}
}
24 changes: 22 additions & 2 deletions DSKitExplorer/ScreenView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,31 @@ struct ScreenView: View {

var body: some View {
switch screen {
case .ImageGalleryScreen1:
case .bookingScreen1:
Testable_BookingScreen1()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
case .bookingScreen2:
Testable_BookingScreen2()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
case .bookingScreen3:
Testable_BookingScreen3()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
case .bookingScreen4:
Testable_BookingScreen4()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
case .bookingScreen5:
Testable_BookingScreen5()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
case .imageGalleryScreen1:
ImageGalleryScreen1()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
case .ImageGalleryScreen2:
case .imageGalleryScreen2:
ImageGalleryScreen2()
.environment(\.appearance, appearance)
.navigationBarHidden(true)
Expand Down
1 change: 0 additions & 1 deletion DSKitExplorer/Screens/AboutUsScreen2.swift
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ final class AboutUsScreen2Model: ObservableObject {
feedbackText: "Grocify has transformed the way I shop for groceries. It's convenient, efficient, and the user interface is fantastic!"
)
]

}

// MARK: - Testable
Expand Down
Loading

0 comments on commit 368d697

Please sign in to comment.