Skip to content

Commit

Permalink
add demoes
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrii Momot committed Oct 18, 2024
1 parent 17a3632 commit 5afefea
Show file tree
Hide file tree
Showing 16 changed files with 167 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Demo/Demo.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,8 @@
9BBC904024FD252B0003D2D8 /* UITraitCollection+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BBC903F24FD252B0003D2D8 /* UITraitCollection+Extensions.swift */; };
B26B58342B4BFEFB000E0245 /* InfoboxSwiftUIViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B26B58332B4BFEFB000E0245 /* InfoboxSwiftUIViewController.swift */; };
B2B8F16B2B483F2F0090573E /* NMPInfoboxViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B2B8F16A2B483F2F0090573E /* NMPInfoboxViewController.swift */; };
B656EA972CC289AB00751289 /* PushNotificationNudgingDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B656EA962CC289AB00751289 /* PushNotificationNudgingDemoView.swift */; };
B656EA992CC28A2600751289 /* PushNotificationNudgingBottomSheetDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B656EA982CC28A2600751289 /* PushNotificationNudgingBottomSheetDemoView.swift */; };
D75E14D727371692008EB126 /* FrontPageSavedSearchFactory.swift in Sources */ = {isa = PBXBuildFile; fileRef = D75E14D627371692008EB126 /* FrontPageSavedSearchFactory.swift */; };
D7C750382731C61A002BDE98 /* FrontPageSavedSearchesDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7C750372731C61A002BDE98 /* FrontPageSavedSearchesDemoView.swift */; };
D7D514C7272942E10065E2F6 /* PromotionDemoView.swift in Sources */ = {isa = PBXBuildFile; fileRef = D7D514C6272942E10065E2F6 /* PromotionDemoView.swift */; };
Expand Down Expand Up @@ -386,6 +388,8 @@
9BBC903F24FD252B0003D2D8 /* UITraitCollection+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UITraitCollection+Extensions.swift"; sourceTree = "<group>"; };
B26B58332B4BFEFB000E0245 /* InfoboxSwiftUIViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = InfoboxSwiftUIViewController.swift; sourceTree = "<group>"; };
B2B8F16A2B483F2F0090573E /* NMPInfoboxViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NMPInfoboxViewController.swift; sourceTree = "<group>"; };
B656EA962CC289AB00751289 /* PushNotificationNudgingDemoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationNudgingDemoView.swift; sourceTree = "<group>"; };
B656EA982CC28A2600751289 /* PushNotificationNudgingBottomSheetDemoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PushNotificationNudgingBottomSheetDemoView.swift; sourceTree = "<group>"; };
D75E14D627371692008EB126 /* FrontPageSavedSearchFactory.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontPageSavedSearchFactory.swift; sourceTree = "<group>"; };
D7C750372731C61A002BDE98 /* FrontPageSavedSearchesDemoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = FrontPageSavedSearchesDemoView.swift; sourceTree = "<group>"; };
D7D514C6272942E10065E2F6 /* PromotionDemoView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PromotionDemoView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1595,6 +1599,8 @@
17F8EEC529409FE3000E26C9 /* SwiftUISelectionListDemoView.swift */,
27FAFCB72988FE6100FEDAE0 /* ToastSwiftUIDemoView.swift */,
277307E4298C108800B8E27F /* ResultSwiftUIDemoView.swift */,
B656EA962CC289AB00751289 /* PushNotificationNudgingDemoView.swift */,
B656EA982CC28A2600751289 /* PushNotificationNudgingBottomSheetDemoView.swift */,
);
path = SwiftUI;
sourceTree = "<group>";
Expand Down Expand Up @@ -1847,6 +1853,7 @@
DA083C2E2462BCA800B26235 /* SwiftUIDemoViews.swift in Sources */,
46E77469242CEF0A008A5E93 /* FavoriteFoldersListViewDemoViewHelpers.swift in Sources */,
46E7741F242CEF0A008A5E93 /* ButtonDemoView.swift in Sources */,
B656EA992CC28A2600751289 /* PushNotificationNudgingBottomSheetDemoView.swift in Sources */,
277307E5298C108800B8E27F /* ResultSwiftUIDemoView.swift in Sources */,
46E773D3242CEF0A008A5E93 /* EmptyViewDemoView.swift in Sources */,
46E77459242CEF0A008A5E93 /* AdRecommendationsGridViewDemoViewHelpers.swift in Sources */,
Expand Down Expand Up @@ -1919,6 +1926,7 @@
D7D514C7272942E10065E2F6 /* PromotionDemoView.swift in Sources */,
46E773D7242CEF0A008A5E93 /* FavoriteAdsListDemoViewController.swift in Sources */,
46E77406242CEF0A008A5E93 /* VisibilityDrivenTitleDemoView.swift in Sources */,
B656EA972CC289AB00751289 /* PushNotificationNudgingDemoView.swift in Sources */,
46E773F5242CEF0A008A5E93 /* SelectorTitleViewDemoView.swift in Sources */,
17EE08632AA8ABCC00A623F2 /* FrontPageTransactionListDemoViewController.swift in Sources */,
46E77435242CEF0A008A5E93 /* PhaseListViewDemo.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"info" : {
"author" : "xcode",
"version" : 1
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "bell.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
{
"images" : [
{
"filename" : "bellOff.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "bottomSheetBell.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "bottomSheetFeedback.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"images" : [
{
"filename" : "bottomSheetSearchFavorites.pdf",
"idiom" : "universal"
}
],
"info" : {
"author" : "xcode",
"version" : 1
},
"properties" : {
"template-rendering-intent" : "template"
}
}
Binary file not shown.
10 changes: 10 additions & 0 deletions Demo/Sources/Assets/ImageAsset.swift
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,13 @@ enum ImageAsset: String {
case autovex
case avatar
case bapShippable
case bell
case bellOff
case betaImageSearch
case blinkRocketMini
case bottomSheetBell
case bottomSheetFeedback
case bottomSheetSearchFavorites
case cabin
case car
case carFront
Expand Down Expand Up @@ -158,8 +163,13 @@ enum ImageAsset: String {
.autovex,
.avatar,
.bapShippable,
.bell,
.bellOff,
.betaImageSearch,
.blinkRocketMini,
.bottomSheetBell,
.bottomSheetFeedback,
.bottomSheetSearchFavorites,
.cabin,
.car,
.carFront,
Expand Down
6 changes: 6 additions & 0 deletions Demo/Sources/Demo/DemoViews/SwiftUIDemoViews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ enum SwiftUIDemoViews: String, CaseIterable, DemoGroup, DemoGroupItem {
case textView
case toast
case resultView
case pushNotificationNudging
case pushNotificationNudgingBottomSheet

static var groupTitle: String { "SwiftUI" }
static var numberOfDemos: Int { allCases.count }
Expand Down Expand Up @@ -54,6 +56,10 @@ enum SwiftUIDemoViews: String, CaseIterable, DemoGroup, DemoGroupItem {
return ToastSwiftUIDemoView_Previews()
case .resultView:
return ResultSwiftUIDemoViewController()
case .pushNotificationNudging:
return PushNotificationNudgingDemoView_Previews()
case .pushNotificationNudgingBottomSheet:
return PushNotificationNudgingBottomSheetDemoView_Previews()
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
import DemoKit
import FinniversKit
import Foundation
import SwiftUI

struct PushNotificationNudgingBottomSheetDemoView_Previews: PreviewProvider, Demoable {
static var previews: some View {
let section1 = PushNotificationNudgingBottomSheetViewModel.Section(
icon: Image(uiImage: UIImage(named: .bottomSheetBell)),
description: "Get real-time alerts when somebody wants to buy your item."
)
let section2 = PushNotificationNudgingBottomSheetViewModel.Section(
icon: Image(uiImage: UIImage(named: .bottomSheetFeedback)),
description: "Reply faster to messages and increase your chances to a quick sale."
)
let section3 = PushNotificationNudgingBottomSheetViewModel.Section(
icon: Image(uiImage: UIImage(named: .bottomSheetSearchFavorites)),
description: "Hear instantly of a new match in your saved search or a price drop on a favourite."
)

let allowButton = PushNotificationNudgingBottomSheetViewModel.Button(
kind: .allow,
title: "Allow Push Notifications"
)
let notNowButton = PushNotificationNudgingBottomSheetViewModel.Button(
kind: .notNow,
title: "Not now"
)

let viewModel = PushNotificationNudgingBottomSheetViewModel(
title: "Don’t miss out on important stuff",
sections: [section1, section2, section3],
buttons: [allowButton, notNowButton]
)

return PushNotificationNudgingBottomSheet(viewModel: viewModel)
}
}
30 changes: 30 additions & 0 deletions Demo/Sources/SwiftUI/PushNotificationNudgingDemoView.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import DemoKit
import FinniversKit
import Foundation
import SwiftUI

struct PushNotificationNudgingDemoView_Previews: PreviewProvider, Demoable {
static var previews: some View {
VStack {
PushNotificationNudgingView(viewModel: PushNotificationNudgingViewModel(
icon: Image(uiImage: UIImage(named: .bellOff)),
title: "Boost your chances of a quick sale!",
description: "Get real-time alerts when buyers message you or express interest in your items.",
state: .initialPrompt
))

PushNotificationNudgingView(viewModel: PushNotificationNudgingViewModel(
icon: Image(uiImage: UIImage(named: .bellOff)),
title: "You won’t get notifications for now",
description: "If you change your mind, you can edit your notification settings anytime.",
state: .tunedOff
))

PushNotificationNudgingView(viewModel: PushNotificationNudgingViewModel(
icon: Image(uiImage: UIImage(named: .bell)),
title: "You’re all set!",
state: .allSet
))
}
}
}

0 comments on commit 5afefea

Please sign in to comment.