Skip to content

Commit

Permalink
Storybook.
Browse files Browse the repository at this point in the history
  • Loading branch information
nagavcindriqim committed Sep 19, 2024
1 parent cd02de4 commit 6d271b1
Show file tree
Hide file tree
Showing 5 changed files with 46 additions and 6 deletions.
14 changes: 9 additions & 5 deletions Demo/Storybook/Storybook.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -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 */; };
Expand All @@ -18,6 +19,7 @@
/* End PBXBuildFile section */

/* Begin PBXFileReference section */
2D6768C22C9C4606007CC431 /* PhotoPreviewComponentView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = PhotoPreviewComponentView.swift; sourceTree = "<group>"; };
990C176C297E98C2005EC7B7 /* PaddingLabelComponentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PaddingLabelComponentView.swift; sourceTree = "<group>"; };
990C176D297E98C2005EC7B7 /* ActionButtonComponentView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = ActionButtonComponentView.swift; sourceTree = "<group>"; };
990C1776297E9D54005EC7B7 /* PovioKit */ = {isa = PBXFileReference; lastKnownFileType = wrapper; name = PovioKit; path = ../..; sourceTree = "<group>"; };
Expand All @@ -35,7 +37,7 @@
isa = PBXFrameworksBuildPhase;
buildActionMask = 2147483647;
files = (
990C1779297E9D96005EC7B7 /* PovioKitUI in Frameworks */,
2D6768C12C9C45CD007CC431 /* PovioKitSwiftUI in Frameworks */,
);
runOnlyForDeploymentPostprocessing = 0;
};
Expand Down Expand Up @@ -102,6 +104,7 @@
children = (
990C176D297E98C2005EC7B7 /* ActionButtonComponentView.swift */,
990C176C297E98C2005EC7B7 /* PaddingLabelComponentView.swift */,
2D6768C22C9C4606007CC431 /* PhotoPreviewComponentView.swift */,
);
path = Components;
sourceTree = "<group>";
Expand All @@ -123,7 +126,7 @@
);
name = Storybook;
packageProductDependencies = (
990C1778297E9D96005EC7B7 /* PovioKitUI */,
2D6768C02C9C45CD007CC431 /* PovioKitSwiftUI */,
);
productName = Storybook;
productReference = 998E6EF3297E82F700D33909 /* Storybook.app */;
Expand Down Expand Up @@ -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 */,
Expand Down Expand Up @@ -399,9 +403,9 @@
/* End XCConfigurationList section */

/* Begin XCSwiftPackageProductDependency section */
990C1778297E9D96005EC7B7 /* PovioKitUI */ = {
2D6768C02C9C45CD007CC431 /* PovioKitSwiftUI */ = {
isa = XCSwiftPackageProductDependency;
productName = PovioKitUI;
productName = PovioKitSwiftUI;
};
/* End XCSwiftPackageProductDependency section */
};
Expand Down
3 changes: 3 additions & 0 deletions Demo/Storybook/Storybook/Component.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import Foundation
enum Component: CaseIterable {
case actionButton
case paddingLabel
case photoPreview
}

extension Component {
Expand All @@ -19,6 +20,8 @@ extension Component {
return "Action Button"
case .paddingLabel:
return "Padding Label"
case.photoPreview:
return "Photo Preview"
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
//

import SwiftUI
import PovioKitUI
import PovioKitSwiftUI

struct ActionButtonComponentView: View {
var body: some View {
Expand Down
Original file line number Diff line number Diff line change
@@ -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
)
}
}
4 changes: 4 additions & 0 deletions Demo/Storybook/Storybook/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ struct ContentView: View {
PaddingLabelComponentView()
.navigationTitle(component.name)
.navigationBarTitleDisplayMode(.large)
case .photoPreview:
PhotoPreviewComponentView()
.navigationTitle(component.name)
.navigationBarTitleDisplayMode(.large)
}
}
}
Expand Down

0 comments on commit 6d271b1

Please sign in to comment.