From 0dd15011ae911a5df91a9d578f72455225dab9b9 Mon Sep 17 00:00:00 2001 From: Hiroshi Kimura Date: Fri, 7 Mar 2025 13:32:19 +0900 Subject: [PATCH] Revert "Add TopBar (#51)" This reverts commit 163396784d273c33e7430c21a1cc1b58afd3eeba. --- Package.swift | 15 ++++++------- Sources/TopBar/TopBar.swift | 42 ------------------------------------- 2 files changed, 6 insertions(+), 51 deletions(-) delete mode 100644 Sources/TopBar/TopBar.swift diff --git a/Package.swift b/Package.swift index 334a8b3..4b2a4db 100644 --- a/Package.swift +++ b/Package.swift @@ -24,28 +24,25 @@ let package = Package( name: "StickyHeader", targets: ["StickyHeader"] ), - .library( - name: "TopBar", - targets: ["TopBar"] - ), ], dependencies: [ .package(url: "https://github.com/FluidGroup/swift-indexed-collection", from: "0.2.1"), .package(url: "https://github.com/siteline/swiftui-introspect", from: "1.3.0"), - .package(url: "https://github.com/FluidGroup/swift-with-prerender", from: "1.0.0"), + .package(url: "https://github.com/FluidGroup/swift-with-prerender", from: "1.0.0") ], targets: [ // Targets are the basic building blocks of a package, defining a module or a test suite. // Targets can depend on other targets in this package and products from dependencies. .target( name: "DynamicList", - dependencies: [] + dependencies: [ + ] ), .target( name: "CollectionView", dependencies: [ "ScrollTracking", - .product(name: "IndexedCollection", package: "swift-indexed-collection"), + .product(name: "IndexedCollection", package: "swift-indexed-collection"), ] ), .target( @@ -57,9 +54,9 @@ let package = Package( ), .target( name: "StickyHeader", - dependencies: [] + dependencies: [ + ] ), - .target(name: "TopBar"), .testTarget( name: "DynamicListTests", dependencies: ["DynamicList"] diff --git a/Sources/TopBar/TopBar.swift b/Sources/TopBar/TopBar.swift deleted file mode 100644 index 1d33eef..0000000 --- a/Sources/TopBar/TopBar.swift +++ /dev/null @@ -1,42 +0,0 @@ -import SwiftUI - -public struct TopBar: View { - - private let content: Content - private let height: CGFloat - private let backgroundColor: Color - - public init( - height: CGFloat = 44, - backgroundColor: Color = Color(.systemBackground), - @ViewBuilder content: () -> Content - ) { - self.height = height - self.backgroundColor = backgroundColor - self.content = content() - } - - public var body: some View { - content - .frame(height: height) - .frame(maxWidth: .infinity, alignment: .center) - .background( - backgroundColor - ) - } -} - -#Preview { - VStack { - TopBar { - HStack { - Text("Title") - .font(.headline) - } - .padding(.horizontal) - } - Spacer() - } - .background(Color.purple) -} -