Skip to content

Commit

Permalink
feat: Replace redaction by a spinner
Browse files Browse the repository at this point in the history
  • Loading branch information
RemiBardon committed Jul 26, 2022
1 parent 0fd0421 commit 3b99807
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 5 additions & 2 deletions Prose/ProseLib/Sources/JoinChatFeature/AddMemberSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ public struct AddMemberSheet: View {
Self.infoMessage(for: viewStore.info)
.symbolVariant(.fill)
.fixedSize(horizontal: false, vertical: true)
.redacted(reason: viewStore.isProcessing ? .placeholder : [])
HStack {
if viewStore.isProcessing {
ProgressView()
.scaleEffect(0.5, anchor: .center)
}
Button { viewStore.send(.cancelTapped) } label: {
Text(verbatim: l10n.CancelAction.label)
}
Expand Down Expand Up @@ -254,7 +257,7 @@ struct AddMemberSheet_Previews: PreviewProvider {
.previewDisplayName("Unknown")
preview(.init(text: "remi@notfinished", info: .invalid))
.previewDisplayName("Not finished")
preview(.init(text: "[email protected]", info: .unknown, isProcessing: true))
preview(.init(text: "[email protected]", info: .none, isProcessing: true))
.previewDisplayName("Processing")
Text("Preview")
.frame(width: 480, height: 360)
Expand Down
7 changes: 5 additions & 2 deletions Prose/ProseLib/Sources/JoinChatFeature/JoinGroupSheet.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,11 @@ public struct JoinGroupSheet: View {
Self.infoMessage(for: viewStore.info)
.symbolVariant(.fill)
.fixedSize(horizontal: false, vertical: true)
.redacted(reason: viewStore.isProcessing ? .placeholder : [])
HStack {
if viewStore.isProcessing {
ProgressView()
.scaleEffect(0.5, anchor: .center)
}
Button { viewStore.send(.cancelTapped) } label: {
Text(verbatim: l10n.CancelAction.label)
}
Expand Down Expand Up @@ -246,7 +249,7 @@ struct JoinGroupSheet_Previews: PreviewProvider {
.previewDisplayName("Unknown")
preview(.init(text: "remi@notfinished", info: .invalid))
.previewDisplayName("Not finished")
preview(.init(text: "[email protected]", info: .invalid, isProcessing: true))
preview(.init(text: "[email protected]", info: .none, isProcessing: true))
.previewDisplayName("Processing")
Text("Preview")
.frame(width: 480, height: 360)
Expand Down

0 comments on commit 3b99807

Please sign in to comment.