-
-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🦺[Tech debt] Add configuration to hide / unhide card tab (#47)
* - Added tests for the Card test group - Added test at launch of locale * Added NonUSTabBar Implemented switching of the tabs * Checked that basic switching works - Added a EXUS ViewContoller - Added the setup code for both EXUS and TabBar ViewContollers - Basic tests * Added cell for locale Added the Locale Detail view * Added “Current Locale” localizations * Polished tests, added locale detail view - Clean up of code - Added SwiftUI Locale Detail View * pre review comments - meeting switch block indentation standards * per review comments. * removed flaky test
- Loading branch information
Showing
30 changed files
with
936 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// LocaleChangeView.swift | ||
// loafwallet | ||
// | ||
// Created by Kerry Washington on 5/11/21. | ||
// Copyright © 2021 Litecoin Foundation. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
|
||
struct LocaleChangeView: View { | ||
|
||
//MARK: - Combine Variables | ||
@ObservedObject | ||
var viewModel: LocaleChangeViewModel | ||
|
||
init(viewModel: LocaleChangeViewModel) { | ||
self.viewModel = viewModel | ||
} | ||
var body: some View { | ||
VStack { | ||
|
||
Text("\(S.Settings.currentLocale) \(viewModel.displayName)") | ||
.font(Font(UIFont.barlowSemiBold(size: 18.0))) | ||
.foregroundColor(.black) | ||
.padding(.leading, 20) | ||
.padding(.top, 10) | ||
|
||
Spacer() | ||
} | ||
} | ||
} | ||
|
||
struct LocaleChangeView_Previews: PreviewProvider { | ||
|
||
static let viewModel = LocaleChangeViewModel() | ||
|
||
static var previews: some View { | ||
|
||
Group { | ||
LocaleChangeView(viewModel: viewModel) | ||
.previewDevice(PreviewDevice(rawValue: DeviceType.Name.iPhoneSE2)) | ||
.previewDisplayName(DeviceType.Name.iPhoneSE2) | ||
|
||
LocaleChangeView(viewModel: viewModel) | ||
.previewDevice(PreviewDevice(rawValue: DeviceType.Name.iPhone8)) | ||
.previewDisplayName(DeviceType.Name.iPhone8) | ||
|
||
LocaleChangeView(viewModel: viewModel) | ||
.previewDevice(PreviewDevice(rawValue: DeviceType.Name.iPhone12ProMax)) | ||
.previewDisplayName(DeviceType.Name.iPhone12ProMax) | ||
} | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
// | ||
// LocaleChangeViewModel.swift | ||
// loafwallet | ||
// | ||
// Created by Kerry Washington on 5/11/21. | ||
// Copyright © 2021 Litecoin Foundation. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
class LocaleChangeViewModel: ObservableObject { | ||
|
||
//MARK: - Combine Variables | ||
@Published | ||
var displayName: String = "" | ||
|
||
init() { | ||
|
||
let currentLocale = Locale.current | ||
|
||
if let regionCode = currentLocale.regionCode, | ||
let name = currentLocale.localizedString(forRegionCode: regionCode) { | ||
displayName = name | ||
} else { | ||
displayName = "-" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.