Skip to content

Commit

Permalink
feat: Create View+underline
Browse files Browse the repository at this point in the history
  • Loading branch information
hhhello0507 committed Jun 24, 2024
1 parent 5bc7eb2 commit a602f6a
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 10 deletions.
11 changes: 1 addition & 10 deletions Sources/ADS/Component/Comment/AlimoComment.swift
Original file line number Diff line number Diff line change
Expand Up @@ -61,16 +61,7 @@ public struct AlimoComment: View {
Text("답글")
.alimoColor(AlimoColor.Label.em)
.alimoFont(.captionM)
.background(
GeometryReader { geometry in
VStack {
Spacer()
Rectangle()
.frame(width: geometry.size.width, height: 1)
.alimoColor(AlimoColor.Label.em)
}
}
)
.underline(color: AlimoColor.Label.em)
.button {
action()
}
Expand Down
17 changes: 17 additions & 0 deletions Sources/ADS/Util/View+underline.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import SwiftUI

public extension View {
func underline(color: SementicColor, height: CGFloat = 1) -> some View {
self
.background(
GeometryReader { geometry in
VStack {
Spacer()
Rectangle()
.frame(width: geometry.size.width, height: height)
.alimoColor(color)
}
}
)
}
}

0 comments on commit a602f6a

Please sign in to comment.