diff --git a/Demo/Storybook/Storybook.xcodeproj/project.pbxproj b/Demo/Storybook/Storybook.xcodeproj/project.pbxproj index 225a7978..3eb3ab55 100644 --- a/Demo/Storybook/Storybook.xcodeproj/project.pbxproj +++ b/Demo/Storybook/Storybook.xcodeproj/project.pbxproj @@ -7,9 +7,10 @@ objects = { /* Begin PBXBuildFile section */ + 2D6768C12C9C45CD007CC431 /* PovioKitSwiftUI in Frameworks */ = {isa = PBXBuildFile; productRef = 2D6768C02C9C45CD007CC431 /* PovioKitSwiftUI */; }; + 2D6768C32C9C4606007CC431 /* PhotoPreviewComponentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 2D6768C22C9C4606007CC431 /* PhotoPreviewComponentView.swift */; }; 990C176E297E98C2005EC7B7 /* PaddingLabelComponentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990C176C297E98C2005EC7B7 /* PaddingLabelComponentView.swift */; }; 990C176F297E98C2005EC7B7 /* ActionButtonComponentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 990C176D297E98C2005EC7B7 /* ActionButtonComponentView.swift */; }; - 990C1779297E9D96005EC7B7 /* PovioKitUI in Frameworks */ = {isa = PBXBuildFile; productRef = 990C1778297E9D96005EC7B7 /* PovioKitUI */; }; 998E6EF7297E82F700D33909 /* StorybookApp.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998E6EF6297E82F700D33909 /* StorybookApp.swift */; }; 998E6EF9297E82F700D33909 /* ContentView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 998E6EF8297E82F700D33909 /* ContentView.swift */; }; 998E6EFB297E82F800D33909 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 998E6EFA297E82F800D33909 /* Assets.xcassets */; }; @@ -18,6 +19,7 @@ /* End PBXBuildFile section */ /* Begin PBXFileReference section */ + 2D6768C22C9C4606007CC431 /* PhotoPreviewComponentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoPreviewComponentView.swift; sourceTree = ""; }; 990C176C297E98C2005EC7B7 /* PaddingLabelComponentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaddingLabelComponentView.swift; sourceTree = ""; }; 990C176D297E98C2005EC7B7 /* ActionButtonComponentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionButtonComponentView.swift; sourceTree = ""; }; 990C1776297E9D54005EC7B7 /* PovioKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = PovioKit; path = ../..; sourceTree = ""; }; @@ -35,7 +37,7 @@ isa = PBXFrameworksBuildPhase; buildActionMask = 2147483647; files = ( - 990C1779297E9D96005EC7B7 /* PovioKitUI in Frameworks */, + 2D6768C12C9C45CD007CC431 /* PovioKitSwiftUI in Frameworks */, ); runOnlyForDeploymentPostprocessing = 0; }; @@ -102,6 +104,7 @@ children = ( 990C176D297E98C2005EC7B7 /* ActionButtonComponentView.swift */, 990C176C297E98C2005EC7B7 /* PaddingLabelComponentView.swift */, + 2D6768C22C9C4606007CC431 /* PhotoPreviewComponentView.swift */, ); path = Components; sourceTree = ""; @@ -123,7 +126,7 @@ ); name = Storybook; packageProductDependencies = ( - 990C1778297E9D96005EC7B7 /* PovioKitUI */, + 2D6768C02C9C45CD007CC431 /* PovioKitSwiftUI */, ); productName = Storybook; productReference = 998E6EF3297E82F700D33909 /* Storybook.app */; @@ -181,6 +184,7 @@ files = ( 998E6EF9297E82F700D33909 /* ContentView.swift in Sources */, 998E6F08297E8AE000D33909 /* Component.swift in Sources */, + 2D6768C32C9C4606007CC431 /* PhotoPreviewComponentView.swift in Sources */, 998E6EF7297E82F700D33909 /* StorybookApp.swift in Sources */, 990C176E297E98C2005EC7B7 /* PaddingLabelComponentView.swift in Sources */, 990C176F297E98C2005EC7B7 /* ActionButtonComponentView.swift in Sources */, @@ -399,9 +403,9 @@ /* End XCConfigurationList section */ /* Begin XCSwiftPackageProductDependency section */ - 990C1778297E9D96005EC7B7 /* PovioKitUI */ = { + 2D6768C02C9C45CD007CC431 /* PovioKitSwiftUI */ = { isa = XCSwiftPackageProductDependency; - productName = PovioKitUI; + productName = PovioKitSwiftUI; }; /* End XCSwiftPackageProductDependency section */ }; diff --git a/Demo/Storybook/Storybook/Component.swift b/Demo/Storybook/Storybook/Component.swift index cc46593d..134064a1 100644 --- a/Demo/Storybook/Storybook/Component.swift +++ b/Demo/Storybook/Storybook/Component.swift @@ -10,6 +10,7 @@ import Foundation enum Component: CaseIterable { case actionButton case paddingLabel + case photoPreview } extension Component { @@ -19,6 +20,8 @@ extension Component { return "Action Button" case .paddingLabel: return "Padding Label" + case.photoPreview: + return "Photo Preview" } } } diff --git a/Demo/Storybook/Storybook/Components/ActionButtonComponentView.swift b/Demo/Storybook/Storybook/Components/ActionButtonComponentView.swift index c0db64b9..2659e9a5 100644 --- a/Demo/Storybook/Storybook/Components/ActionButtonComponentView.swift +++ b/Demo/Storybook/Storybook/Components/ActionButtonComponentView.swift @@ -6,7 +6,7 @@ // import SwiftUI -import PovioKitUI +import PovioKitSwiftUI struct ActionButtonComponentView: View { var body: some View { diff --git a/Demo/Storybook/Storybook/Components/PhotoPreviewComponentView.swift b/Demo/Storybook/Storybook/Components/PhotoPreviewComponentView.swift new file mode 100644 index 00000000..90dbee7d --- /dev/null +++ b/Demo/Storybook/Storybook/Components/PhotoPreviewComponentView.swift @@ -0,0 +1,29 @@ +// +// PhotoPreviewComponentView.swift +// Storybook +// +// Created by Ndriqim Nagavci on 19/09/2024. +// + +import PovioKitSwiftUI +import SwiftUI + +struct PhotoPreviewComponentView: View { + @State private var showPhotoPreview = false + private var items: [PhotoPreviewItem] = [ + .init(image: Image("PovioKit")), + .init(url: .init(string: "https://raw.githubusercontent.com/poviolabs/PovioKit/develop/Resources/PovioKit.png")) + ] + + var body: some View { + Button { + showPhotoPreview.toggle() + } label: { + Text("Show Photo Preview") + } + .photoPreview( + present: $showPhotoPreview, + items: items + ) + } +} diff --git a/Demo/Storybook/Storybook/ContentView.swift b/Demo/Storybook/Storybook/ContentView.swift index f5241750..61269edc 100644 --- a/Demo/Storybook/Storybook/ContentView.swift +++ b/Demo/Storybook/Storybook/ContentView.swift @@ -46,6 +46,10 @@ struct ContentView: View { PaddingLabelComponentView() .navigationTitle(component.name) .navigationBarTitleDisplayMode(.large) + case .photoPreview: + PhotoPreviewComponentView() + .navigationTitle(component.name) + .navigationBarTitleDisplayMode(.large) } } }