Skip to content

Commit

Permalink
refactor: switch to #Preview
Browse files Browse the repository at this point in the history
  • Loading branch information
mattrighetti committed Nov 5, 2023
1 parent 54e1250 commit b4f470e
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 21 deletions.
Binary file not shown.
12 changes: 5 additions & 7 deletions HNReader/View/Components/HTMLText.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,9 @@ struct HTMLText: NSViewRepresentable {
func updateNSView(_ nsView: NSViewType, context: Context) {}
}

struct HTMLText_Previews: PreviewProvider {
static var previews: some View {
HTMLText(text: """
string <h1>Krupal testing <span style="font-weight:
bold;">Customer WYWO</span></h1>
""")
}
#Preview {
HTMLText(text: """
string <h1>Krupal testing <span style="font-weight:
bold;">Customer WYWO</span></h1>
""")
}
5 changes: 3 additions & 2 deletions HNReader/View/ConditionalRedactedModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@ extension View {

#Preview {
VStack {
Text("Some Text").redactIfNull(Optional<String>.none)
Text("Some Text")
.redactIfNull(Optional<String>.none)
}
.frame(width: 500, height: 500)
.frame(width: 200, height: 100)
}
6 changes: 2 additions & 4 deletions HNReader/View/HomeView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,6 @@ struct Sidebar: View {
}
}

struct HomeView_Previews: PreviewProvider {
static var previews: some View {
HomeView()
}
#Preview {
HomeView()
}
6 changes: 2 additions & 4 deletions HNReader/View/ItemCell.swift
Original file line number Diff line number Diff line change
Expand Up @@ -141,8 +141,6 @@ struct ItemCell: View {
}
}

struct ItemCell_Previews: PreviewProvider {
static var previews: some View {
ItemCell(itemId: 27492268)
}
#Preview {
ItemCell(itemId: 27492268)
}
6 changes: 2 additions & 4 deletions HNReader/View/ItemList.swift
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,6 @@ struct ItemList: View {
}
}

struct ItemList_Previews: PreviewProvider {
static var previews: some View {
ItemList()
}
#Preview {
ItemList()
}

0 comments on commit b4f470e

Please sign in to comment.