Skip to content

Commit

Permalink
Code cleanup (#22)
Browse files Browse the repository at this point in the history
Co-authored-by: PraveenP <ppraveetr@gmail.com>
  • Loading branch information
ppraveentr and PraveenP authored Jun 17, 2024
1 parent cf3a4d4 commit 8e32134
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 23 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ fastlane/report.xml
*.xcuserstate
*.resolved
reports/**
build/*
8 changes: 4 additions & 4 deletions ExampleApp/ExampleApp/ContentView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ struct ContentView: View {
}
}

struct ContentView_Previews: PreviewProvider {
static var previews: some View {
ContentView()
}
// MARK: Preview

#Preview {
ContentView()
}
12 changes: 5 additions & 7 deletions ExampleApp/ExampleApp/Views/ExTextView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,9 @@ struct ExTextView: View {

// MARK: Preview

struct ExTextView_Previews: PreviewProvider {
static var previews: some View {
ExTextView()
.task {
await ThemeLoader.setupApplicationTheme()
}
}
#Preview {
ExTextView()
.task {
await ThemeLoader.setupApplicationTheme()
}
}
12 changes: 5 additions & 7 deletions Sources/Theme/ViewModifiers/ColorModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -58,16 +58,14 @@ public extension View {
}
}

// MARK: Preview
// MARK: Preview

struct ColorModifier_Previews: PreviewProvider {
static var previews: some View {
Text("""
#Preview {
Text("""
Sample Color:
blue foreground Color
green background Color
""")
.theme(.foreground(color: .init(.blue)))
.theme(.background(color: .init(.green), ignoreSafeArea: false))
}
.theme(.foreground(color: .init(.blue)))
.theme(.background(color: .init(.green), ignoreSafeArea: false))
}
8 changes: 3 additions & 5 deletions Sources/Theme/ViewModifiers/FontModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -38,13 +38,11 @@ public extension View {

// MARK: Preview

struct FontModifier_Previews: PreviewProvider {
static var previews: some View {
Text("""
#Preview {
Text("""
Sample Text Font:
headline in Light-Mode
caption in Dark-Mode
""")
.theme(.init(Font.headline, dark: Font.caption))
}
.theme(.init(Font.headline, dark: Font.caption))
}

0 comments on commit 8e32134

Please sign in to comment.