Skip to content

Commit

Permalink
Use conditional modifier
Browse files Browse the repository at this point in the history
  • Loading branch information
yllfejziu committed Nov 21, 2024
1 parent 5de478e commit 9db1161
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 22 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,16 @@ struct ProjectFormView: View {
}
.padding()
.overlay {
if copied {
Text(Lingua.ProjectForm.copiedToClipboard)
.padding(8)
.background(
Color.black
.opacity(0.4)
)
.clipShape(RoundedRectangle(cornerRadius: 6))
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
.padding(.top, 6)
}
Text(Lingua.ProjectForm.copiedToClipboard)
.padding(8)
.background(
Color.black
.opacity(0.4)
)
.clipShape(RoundedRectangle(cornerRadius: 6))
.frame(maxWidth: .infinity, maxHeight: .infinity, alignment: .top)
.padding(.top, 6)
.shouldAddView(copied)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,17 +40,16 @@ struct DirectoryInputField: View {
.padding(.vertical, 5)
.background(
GeometryReader { geometry in
if isHovered {
Text(directoryPath)
.font(.caption)
.padding(8)
.background(Color.black.opacity(0.8))
.foregroundColor(.white)
.cornerRadius(8)
.frame(width: geometry.size.width, alignment: .center)
.offset(y: -geometry.size.height)
.transition(.opacity)
}
Text(directoryPath)
.font(.caption)
.padding(8)
.background(Color.black.opacity(0.8))
.foregroundColor(.white)
.cornerRadius(8)
.frame(width: geometry.size.width, alignment: .center)
.offset(y: -geometry.size.height)
.transition(.opacity)
.shouldAddView(isHovered)
}
)
}
Expand Down

0 comments on commit 9db1161

Please sign in to comment.