Skip to content

Commit

Permalink
Removed #Previews for now
Browse files Browse the repository at this point in the history
  • Loading branch information
bdrelling committed Mar 2, 2024
1 parent 65dc269 commit edad3ec
Show file tree
Hide file tree
Showing 6 changed files with 60 additions and 49 deletions.
20 changes: 11 additions & 9 deletions Sources/KippleFont/Views/FontTester.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,14 +94,16 @@ public extension Array where Element == ColorPair {

// MARK: - Previews

#Preview {
FontTester(
columns: 2,
colors: .default + [
.init(foreground: .white, background: .blue),
.init(foreground: .blue, background: .white),
]
) {
Text("Lorem ipsum")
struct FontTester_Previews: PreviewProvider {
static var previews: some View {
FontTester(
columns: 2,
colors: .default + [
.init(foreground: .white, background: .blue),
.init(foreground: .blue, background: .white),
]
) {
Text("Lorem ipsum")
}
}
}
26 changes: 14 additions & 12 deletions Sources/KippleUI/SwiftUI/Core/ViewModifiers/View+Modify.swift
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@ public extension View {

// MARK: - Previews

#Preview {
Color.blue
.modify { view in
#if os(iOS)
view.overlay {
Text("iOS")
struct View_Modify_Previews: PreviewProvider {
static var previews: some View {
Color.blue
.modify { view in
#if os(iOS)
view.overlay {
Text("iOS")
}
#else
view.overlay {
Text("Not iOS!")
}
#endif
}
#else
view.overlay {
Text("Not iOS!")
}
#endif
}
}
}
20 changes: 11 additions & 9 deletions Sources/KippleUI/SwiftUI/Graphics/Shapes/Hexagon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,14 +30,16 @@ public struct Hexagon: Shape {

// MARK: - Previews

#Preview {
VStack {
Hexagon(orientation: .horizontal)
.fill(.red)
.aspectRatio(contentMode: .fit)

Hexagon(orientation: .vertical)
.fill(.red)
.aspectRatio(contentMode: .fit)
struct Hexagon_Previews: PreviewProvider {
static var previews: some View {
VStack {
Hexagon(orientation: .horizontal)
.fill(.red)
.aspectRatio(contentMode: .fit)

Hexagon(orientation: .vertical)
.fill(.red)
.aspectRatio(contentMode: .fit)
}
}
}
11 changes: 6 additions & 5 deletions Sources/KippleUI/SwiftUI/Graphics/Shapes/PointedStar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,10 @@ public struct PointedStar: Shape {
}

// MARK: - Previews

#Preview {
PointedStar()
.fill(.red)
.aspectRatio(contentMode: .fit)
struct Star_Previews: PreviewProvider {
static var previews: some View {
PointedStar()
.fill(.red)
.aspectRatio(contentMode: .fit)
}
}
10 changes: 6 additions & 4 deletions Sources/KippleUI/SwiftUI/Graphics/Shapes/Polygon.swift
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ public struct Polygon: Shape {

// MARK: - Previews

#Preview {
Polygon(sides: 10)
.fill(.red)
.aspectRatio(contentMode: .fit)
struct Polygon_Previews: PreviewProvider {
static var previews: some View {
Polygon(sides: 10)
.fill(.red)
.aspectRatio(contentMode: .fit)
}
}
22 changes: 12 additions & 10 deletions Sources/KippleUI/SwiftUI/Graphics/Shapes/Quadrilateral.swift
Original file line number Diff line number Diff line change
Expand Up @@ -49,15 +49,17 @@ extension UnitPoint {

// MARK: - Previews

#Preview {
VStack {
Quadrilateral()
.fill(.red)
.aspectRatio(contentMode: .fit)

Quadrilateral(points: [.topLeading, .top, .bottomTrailing, .bottomLeading])
.fill(.red)
.aspectRatio(contentMode: .fit)
struct Quadrilateral_Previews: PreviewProvider {
static var previews: some View {
VStack {
Quadrilateral()
.fill(.red)
.aspectRatio(contentMode: .fit)

Quadrilateral(points: [.topLeading, .top, .bottomTrailing, .bottomLeading])
.fill(.red)
.aspectRatio(contentMode: .fit)
}
.padding()
}
.padding()
}

0 comments on commit edad3ec

Please sign in to comment.