Skip to content

Commit

Permalink
fix: PageView indicator color
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhello0507 committed Aug 16, 2024
1 parent c2434a9 commit 0611b0f
Showing 1 changed file with 31 additions and 24 deletions.
55 changes: 31 additions & 24 deletions Source/DDS/Component/PageView/PageView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ public struct DodamPageView: View {
HStack(spacing: 5) {
ForEach(contents.indices, id: \.self) { idx in
Circle()
.dodamFill(selected == idx ? DodamColor.Background.normal : DodamColor.Background.alternative)
.dodamFill(selected == idx ? DodamColor.Primary.normal : DodamColor.Label.disable)
.frame(width: 5, height: 5)
}
}
Expand All @@ -49,30 +49,37 @@ public struct DodamPageView: View {
}
}

#Preview {
struct DodamPagePreview: View {

@State private var selection: Int = 0

var body: some View {
DodamPageView(selection: $selection) {
Button("Next") {
selection += 1
}
.page()
Button("Next") {
selection += 1
}
.page()
Button("First") {
selection = 0
}
.page()

private struct DodamPagePreview: View {

@State private var selection: Int = 0

var body: some View {
DodamPageView(selection: $selection) {
Button("Next") {
selection += 1
}
.page()
Button("Next") {
selection += 1
}
.frame(height: 50)
.padding()
.registerPretendard()
.page()
Button("First") {
selection = 0
}
.page()
}
.frame(height: 50)
.padding()
.registerPretendard()
}
return DodamPagePreview()
}

#Preview {
DodamPagePreview()
}

#Preview {
DodamPagePreview()
.preferredColorScheme(.dark)
}

0 comments on commit 0611b0f

Please sign in to comment.