feat(signUp) add sign up using link - #31
Conversation
|
fyi @alex-npmn @ckost9n For some reason, I can't assign reviewers to this PR, so I'll just ping you here 🙂 I'd really appreciate your feedback whenever you get a chance. ty |
| set: { if !$0 { viewModel.alert = nil } }, | ||
| ), | ||
| actions: { | ||
| Button("scan_enter_error_alert_button_okay", role: .cancel) { |
There was a problem hiding this comment.
use button init with LocalizedStringResource
| } | ||
| }, | ||
| message: { | ||
| Text(viewModel.alert?.message ?? String(localized: "error_base_message")) |
There was a problem hiding this comment.
I believe its better to set error message in view model, avoiding nil coalescing here and show Text only if error message is not nil
| Image(systemName: "qrcode.viewfinder") | ||
| .font(.system(size: 56)) | ||
| .padding(.bottom, 8) | ||
|
|
There was a problem hiding this comment.
please extract it as private property inside view and use here, there is an example in last merged pr
| Text("scan_enter_info_title") | ||
| .font(.title3) | ||
| .multilineTextAlignment(.center) | ||
| .padding(.horizontal, 16) |
| Text("scan_enter_info_subtitle") | ||
| .font(.subheadline) | ||
| .foregroundStyle(.secondary) | ||
| .multilineTextAlignment(.center) | ||
| .padding(.horizontal, 16) |
| HStack { | ||
| Image(systemName: "link") | ||
| .foregroundStyle(.secondary) | ||
|
|
||
| TextField("invite_link", text: $viewModel.inviteLinkText) | ||
| .focused($isLinkTextFieldFocused) | ||
| .font(.body) | ||
| .frame(maxWidth: .infinity) | ||
| .keyboardType(.URL) | ||
| .autocorrectionDisabled() | ||
| .autocapitalization(.none) | ||
| .onSubmit { viewModel.handleEnteredInviteLinkText() } | ||
| .overlay(alignment: .trailing) { | ||
| if viewModel.inviteLinkText.isEmpty { |
| .padding(.trailing, 8) | ||
| } | ||
| } | ||
| .onTapGesture { isLinkTextFieldFocused = true } |
| Button { | ||
| viewModel.openScanner() | ||
| } label: { | ||
| Text("scan_enter_open_scanner") | ||
| .font(.headline) | ||
| .frame(maxWidth: .infinity) | ||
| .padding() | ||
| } | ||
| .keyboardShortcut(.defaultAction) | ||
| .buttonStyle(.glassProminent) | ||
| .padding(.horizontal) |
| matching: .images, | ||
| photoLibrary: .shared() | ||
| ) { | ||
| Text("scan_enter_open_photo_scanner") |
There was a problem hiding this comment.
use LocalizedStringResource init
| title: String(localized: "scan_enter_error_alert_title_default"), | ||
| message: String(localized: "scan_enter_photo_invalid_image"), |
| let title: String | ||
| let message: String? |
There was a problem hiding this comment.
| let title: String | |
| let message: String? | |
| let title: LocalizedStringResource | |
| let message: LocalizedStringResource? |
| ), | ||
| actions: { | ||
| Button( | ||
| LocalizedStringResource("scan_enter_error_alert_button_okay"), |
There was a problem hiding this comment.
it has built in codegen for LocalizedStringResource,
so your code should look like this
Button(.scanEnterErrorAlertButtonOkay, role: .cancel) {
viewModel.resetState()
}
here and at all the rest of branch, please check it, at least just run claude code to fix it
There was a problem hiding this comment.
same for texts and the most amount of swiftUI views, they have LocalizedStringResource init
issue
Additionally
I made a few small improvements as part of this PR:
Attachments
phone
pad