Skip to content

Commit

Permalink
Rm some useless @ViewBuilder
Browse files Browse the repository at this point in the history
  • Loading branch information
Kjuly committed Jun 20, 2024
1 parent 6416492 commit 8401542
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,6 @@ public struct KYNearbyConnectionView: View {

// MARK: - Private (Visible to Others As)

@ViewBuilder
private func _visibleToOthersAsCell() -> some View {
HStack {
_visibleToOthersAsTextField()
Expand All @@ -152,7 +151,6 @@ public struct KYNearbyConnectionView: View {
.listRowBackground(self.secondaryBackgroundColor)
}

@ViewBuilder
private func _visibleToOthersAsTextField() -> some View {
TextField(
"",
Expand All @@ -177,7 +175,6 @@ public struct KYNearbyConnectionView: View {

// MARK: - Private (Users Nearby)

@ViewBuilder
private func _noUserFoundView() -> some View {
VStack(alignment: .center, spacing: KYNearbyConnectionViewDimension.Margin.level_1, content: {
Text("LS:No User Found:Title".ky_nearbyServiceLocalized)
Expand All @@ -192,7 +189,6 @@ public struct KYNearbyConnectionView: View {
.listRowBackground(self.defaultBackgroundColor)
}

@ViewBuilder
private func _usersNearbyView() -> some View {
ForEach(self.viewModel.peers, id: \.peerID) { item in
KYNearbyConnectionPeerCell(item: item)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,28 +43,24 @@ extension KYNearbyConnectionPeerCell {

// MARK: - Private

@ViewBuilder
func _newActionOfConnectItem(_ item: KYNearbyPeerModel) -> some View {
Button("LS:Connect".ky_nearbyServiceLocalized) {
KYNearbyService.shared.invitePeerItem(item)
}
}

@ViewBuilder
func _newActionOfSendResource(for item: KYNearbyPeerModel) -> some View {
Button("LS:Send".ky_nearbyServiceLocalized) {
p_askToSendResource(for: item)
}
}

@ViewBuilder
func _newActionOfTerminateProcessingItem(_ item: KYNearbyPeerModel) -> some View {
Button("LS:Terminate".ky_nearbyServiceLocalized, role: .destructive) {
KYNearbyService.shared.terminateProcessingIfNeededForItem(item)
}
}

@ViewBuilder
func _newActionOfDisconnectItem(_ item: KYNearbyPeerModel) -> some View {
Button("LS:Disconnect".ky_nearbyServiceLocalized, role: .destructive) {
KYNearbyService.shared.terminateProcessingIfNeededForItem(item)
Expand All @@ -74,14 +70,12 @@ extension KYNearbyConnectionPeerCell {

// MARK: - Private (Block & Unblock)

@ViewBuilder
func _newActionOfBlockItem(_ item: KYNearbyPeerModel) -> some View {
Button("LS:Block".ky_nearbyServiceLocalized, role: .destructive) {
KYNearbyService.shared.setPeerItem(item, blocked: true)
}
}

@ViewBuilder
func _newActionOfUnblockItem(_ item: KYNearbyPeerModel) -> some View {
Button("LS:Unblock".ky_nearbyServiceLocalized) {
KYNearbyService.shared.setPeerItem(item, blocked: false)
Expand All @@ -90,7 +84,6 @@ extension KYNearbyConnectionPeerCell {

// MARK: - Private (Cancel)

@ViewBuilder
func _newActionOfCancel() -> some View {
Button("LS:Cancel".ky_nearbyServiceLocalized, role: .cancel) {
self.isPresentingActions = false
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ struct KYNearbyConnectionPeerCell: View {
}
}

@ViewBuilder
private func _mainContentRow() -> some View {
HStack(alignment: .center, spacing: KYNearbyConnectionViewDimension.PeerCell.horizontalSpacing) {
// Peer Status & Name
Expand Down Expand Up @@ -157,7 +156,6 @@ struct KYNearbyConnectionPeerCell: View {
.frame(maxWidth: .infinity, alignment: .leading)
}

@ViewBuilder
private func _connectionStatusIndicatorLabel() -> some View {
Text(self.item.connectionStatus.text)
.font(self.smallFontInBold)
Expand All @@ -168,7 +166,6 @@ struct KYNearbyConnectionPeerCell: View {
.cornerRadius(KYNearbyConnectionViewDimension.ViewCornerRadius.regular)
}

@ViewBuilder
private func _connectingIndicator() -> some View {
HStack(spacing: KYNearbyConnectionViewDimension.Margin.level_2) {
Text("LS:Connection Status:Connecting".ky_nearbyServiceLocalized)
Expand All @@ -179,7 +176,6 @@ struct KYNearbyConnectionPeerCell: View {
}
}

@ViewBuilder
private func _sendButton() -> some View {
Button {
p_askToSendResource(for: self.item)
Expand All @@ -190,7 +186,6 @@ struct KYNearbyConnectionPeerCell: View {
.buttonStyle(.bordered)
}

@ViewBuilder
private func _terminateDataProcessingButton() -> some View {
Button {
KYNearbyService.shared.terminateProcessingIfNeededForItem(self.item)
Expand Down Expand Up @@ -228,7 +223,6 @@ struct KYNearbyConnectionPeerCell: View {
}
}

@ViewBuilder
private func _errorLabel() -> some View {
Text(self.item.processErrorMessage ?? "")
.font(self.smallFont)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ struct ContentView: View {

// MARK: - Private (File Selection)

@ViewBuilder
private func _fileSelectionSection() -> some View {
Section {
Text(self.viewModel.selectedFilename ?? "None")
Expand All @@ -90,7 +89,6 @@ struct ContentView: View {
}
}

@ViewBuilder
private func _archivesSelectionView() -> some View {
ArchivesSelectionView()
.environmentObject(self.viewModel)
Expand Down

0 comments on commit 8401542

Please sign in to comment.