Skip to content

Commit

Permalink
Remove conditional modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
kevinneko committed Jul 23, 2024
1 parent e823b5b commit fa577b1
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 32 deletions.
34 changes: 18 additions & 16 deletions Sources/CharcoalSwiftUI/Components/Tooltip/CharcoalTooltip.swift
Original file line number Diff line number Diff line change
Expand Up @@ -85,22 +85,24 @@ struct CharcoalTooltip: CharcoalPopupProtocol {

var body: some View {
ZStack {
Color.clear
.if(dismissOnTouchOutside && isPresenting) { view in
view.contentShape(Rectangle())
.simultaneousGesture(
TapGesture()
.onEnded { _ in
isPresenting = false
}
)
.simultaneousGesture(
DragGesture()
.onChanged { _ in
isPresenting = false
}
)
}
if dismissOnTouchOutside && isPresenting {
Color.clear
.contentShape(Rectangle())
.simultaneousGesture(
TapGesture()
.onEnded { _ in
isPresenting = false
}
)
.simultaneousGesture(
DragGesture()
.onChanged { _ in
isPresenting = false
}
)
} else {
Color.clear
}
if isPresenting {
GeometryReader(content: { canvasGeometry in
VStack {
Expand Down
16 changes: 0 additions & 16 deletions Sources/CharcoalSwiftUI/Extensions/ConditionalViewModifier.swift

This file was deleted.

0 comments on commit fa577b1

Please sign in to comment.