Skip to content

Commit

Permalink
Reset code latters
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-amisha-i committed Jan 1, 2025
1 parent 81fd22c commit 37582c6
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion BaseStyle/BaseStyle/Extension/String+Extension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ extension String {
}

public func randomString(length: Int) -> String {
let letters = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
let letters = "ABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789"
return String((0..<length).compactMap { _ in letters.randomElement() })
}
}
Expand Down
6 changes: 3 additions & 3 deletions Splito/UI/Home/Groups/Add Member/JoinMemberView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,22 @@ public struct JoinMemberTextInputView: View {
.multilineTextAlignment(.center)
.textContentType(.oneTimeCode)
.autocorrectionDisabled()
.autocapitalization(.allCharacters)
.onChange(of: text) { newValue in
// Restrict the length of text
if newValue.count > CODE_TOTAL_CHARACTERS {
text = String(newValue.prefix(CODE_TOTAL_CHARACTERS))
text = String(newValue.prefix(CODE_TOTAL_CHARACTERS)).uppercased()
return
}

// Validate input characters by allowing only alphanumeric
text = newValue.filter { $0.isLetter || $0.isNumber }
text = newValue.filter { $0.isLetter || $0.isNumber }.uppercased()

if newValue.count == CODE_TOTAL_CHARACTERS {
onCodeChange()
isFocused.wrappedValue = false
}
}
.textInputAutocapitalization(.characters)
.onAppear {
isFocused.wrappedValue = true
}
Expand Down
10 changes: 5 additions & 5 deletions Splito/UI/Home/Groups/Create Group/CreateGroupView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -22,24 +22,24 @@ struct CreateGroupView: View {
ScrollView {
VStack(spacing: 0) {
VSpacer(40)

AddGroupImageView(showImagePickerOptions: $viewModel.showImagePickerOptions,
image: viewModel.profileImage, imageUrl: viewModel.profileImageUrl,
handleProfileTap: viewModel.handleProfileTap,
handleActionSelection: viewModel.handleActionSelection(_:))

VSpacer(30)

AddGroupNameView(groupName: $viewModel.groupName)
.focused($isFocused)

Spacer(minLength: 130)
}
.padding(.horizontal, 16)
}
.scrollIndicators(.hidden)
.scrollBounceBehavior(.basedOnSize)

PrimaryButton(text: viewModel.group != nil ? "Save" : "Create", isEnabled: viewModel.groupName.count >= 3, showLoader: viewModel.showLoader, onClick: {
Task {
let isSucceed = await viewModel.handleDoneAction()
Expand Down

0 comments on commit 37582c6

Please sign in to comment.