Skip to content

Commit

Permalink
SIANXSVC-1229: remove and deactivate menu entries
Browse files Browse the repository at this point in the history
  • Loading branch information
anx-bkelhar committed Mar 26, 2024
1 parent 547b5d1 commit 71dd889
Show file tree
Hide file tree
Showing 13 changed files with 32 additions and 113 deletions.
4 changes: 1 addition & 3 deletions TwoFAS/Data/MainRepository/DataTypes/SocialChannel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,9 @@
import Foundation

public enum SocialChannel: Hashable {
case discord
case instagram
case youtube
case twitter
case github
case facebook
case reddit
case linkedin
}

This file was deleted.

Binary file not shown.
20 changes: 7 additions & 13 deletions TwoFAS/TwoFAS/Other/Configs.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,32 +23,26 @@ import Data
extension SocialChannel {
var url: URL {
switch self {
case .discord:
return URL(string: "https://discord.gg/q4cP6qh2g5")!
case .youtube:
return URL(string: "https://www.youtube.com/@2fas")!
return URL(string: "https://www.youtube.com/user/anexiagmbh")!
case .twitter:
return URL(string: "https://twitter.com/2fas_com")!
case .github:
return URL(string: "https://github.com/twofas")!
return URL(string: "https://twitter.com/_anexia")!
case .facebook:
return URL(string: "https://facebook.com/twofas")!
case .reddit:
return URL(string: "https://www.reddit.com/r/2fas_com")!
return URL(string: "https://www.facebook.com/anexiagmbh")!
case .instagram:
return URL(string: "https://www.instagram.com/_anexia")!
case .linkedin:
return URL(string: "https://www.linkedin.com/company/2fasapp/")!
return URL(string: "https://at.linkedin.com/company/anexia")!
}
}

var name: String {
switch self {
case .discord: return T.Social.discord
case .youtube: return T.Social.youtube
case .twitter: return T.Social.twitter
case .github: return T.Social.github
case .facebook: return T.Social.facebook
case .reddit: return T.Social.reddit
case .linkedin: return T.Social.linkedin
case .instagram: return T.Social.instagram
}
}
}
2 changes: 2 additions & 0 deletions TwoFAS/TwoFAS/Other/Generated/T.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,8 @@ internal enum T {
internal static let twitter = T.tr("Localizable", "social__twitter", fallback: "X (formerly Twitter)")
/// YouTube
internal static let youtube = T.tr("Localizable", "social__youtube", fallback: "YouTube")
/// Instagram
internal static let instagram = T.tr("Localizable", "social__instagram", fallback: "Instagram")
}
internal enum Tokens {
/// Point your camera at the screen to capture the QR code.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ final class UserIconInfoFlowController: FlowController {

extension UserIconInfoFlowController: UserIconInfoFlowControlling {
func toSocial() {
UIApplication.shared.open(SocialChannel.discord.url, completionHandler: nil)
// UIApplication.shared.open(SocialChannel.discord.url, completionHandler: nil)
}

func toShare() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ extension AboutFlowController: AboutFlowControlling {
func toWriteReview() {
UIApplication.shared.open(
URL(
string: "https://itunes.apple.com/us/app/2fa-authenticator-2fas/id1217793794?mt=8&action=write-review"
string: "https://itunes.apple.com/at/app/anexia-authenticator/id1358602833?mt=8&action=write-review"
)!,
options: [:],
completionHandler: nil
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,19 +25,14 @@ extension AboutPresenter {
.init(title: T.Settings.general, cells: [
.init(title: T.Settings.writeAReview, accessory: .external, action: .writeReview),
.init(title: T.Settings.privacyPolicy, accessory: .external, action: .privacyPolicy),
.init(title: T.Settings.termsOfService, accessory: .external, action: .tos),
.init(title: T.Settings.acknowledgements, accessory: .external, action: .acknowledgements)
]),
.init(title: T.Settings.shareApp, cells: [
.init(title: T.Settings.tellAFriend, accessory: .share, action: .share)
]),

]),
.init(title: T.Social.socialMedia, cells: [
.init(
title: T.Social.discord,
title: T.Social.instagram,
accessory: .external,
action: .social(.discord),
icon: Asset.socialDiscord.image
action: .social(.instagram),
icon: nil
),
.init(
title: T.Social.youtube,
Expand All @@ -51,34 +46,19 @@ extension AboutPresenter {
action: .social(.twitter),
icon: Asset.socialTwitter.image
),
.init(
title: T.Social.github,
accessory: .external,
action: .social(.github),
icon: Asset.socialGithub.image
),
.init(
title: T.Social.linkedin,
accessory: .external,
action: .social(.linkedin),
icon: Asset.socialLinkedin.image
),
.init(
title: T.Social.reddit,
accessory: .external,
action: .social(.reddit),
icon: Asset.socialReddit.image
),
.init(
title: T.Social.facebook,
accessory: .external,
action: .social(.facebook),
icon: Asset.socialFacebook.image
)
]),
.init(title: T.Settings.support, cells: [
.init(title: T.Settings.sendLogs, accessory: .noAccessory, action: .sendLogs)
]),
.init(
title: T.Settings.aboutCrashOptoutTitle,
cells: [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,26 +116,13 @@ extension SettingsMenuPresenter {
let info = SettingsMenuSection(
title: T.Commons.info,
cells: [
.init(
icon: Asset.settingsFAQ.image,
title: T.Settings.support,
accessory: .external,
action: .navigation(navigatesTo: .faq)
),
.init(
icon: Asset.settingsInfo.image,
title: T.Settings.about,
accessory: .arrow,
action: .navigation(navigatesTo: .about)
),
.init(
icon: Asset.settingsDonate.image,
title: T.Settings.donateTwofas,
accessory: .donate,
action: .navigation(navigatesTo: .donate)
)
],
footer: T.Settings.infoFooter
]
)

var menu: [SettingsMenuSection] = []
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ final class SettingsViewFooter: UIView {

var openURL: ((SocialChannel) -> Void)?

private var discordButton: UIButton = {
private var facebookButton: UIButton = {
let button = UIButton()
button.setImage(Asset.socialLargeDiscord.image, for: .normal)
button.accessibilityLabel = T.Social.discord
// button.setImage(Asset.socialLargeFaceboook.image, for: .normal)
button.accessibilityLabel = T.Social.facebook
return button
}()

Expand All @@ -49,10 +49,10 @@ final class SettingsViewFooter: UIView {
return button
}()

private var githubButton: UIButton = {
private var instagramButton: UIButton = {
let button = UIButton()
button.setImage(Asset.socialLargeGithub.image, for: .normal)
button.accessibilityLabel = T.Social.github
// button.setImage(Asset.socialLargeInstagram.image, for: .normal)
button.accessibilityLabel = T.Social.instagram
return button
}()

Expand Down Expand Up @@ -89,12 +89,12 @@ final class SettingsViewFooter: UIView {
constraint = stackView.centerXAnchor.constraint(equalTo: centerXAnchor)
constraint?.isActive = true

stackView.addArrangedSubviews([discordButton, youtubeButton, twitterButton, githubButton])
stackView.addArrangedSubviews([facebookButton, youtubeButton, twitterButton, instagramButton])

discordButton.addTarget(self, action: #selector(discordAction), for: .touchUpInside)
facebookButton.addTarget(self, action: #selector(facebookAction), for: .touchUpInside)
youtubeButton.addTarget(self, action: #selector(youtubeAction), for: .touchUpInside)
twitterButton.addTarget(self, action: #selector(twitterAction), for: .touchUpInside)
githubButton.addTarget(self, action: #selector(githubAction), for: .touchUpInside)
instagramButton.addTarget(self, action: #selector(instagramAction), for: .touchUpInside)
}

override func layoutMarginsDidChange() {
Expand All @@ -105,8 +105,8 @@ final class SettingsViewFooter: UIView {
}

@objc
private func discordAction() {
openURL?(.discord)
private func facebookAction() {
openURL?(.facebook)
}

@objc
Expand All @@ -120,7 +120,7 @@ final class SettingsViewFooter: UIView {
}

@objc
private func githubAction() {
openURL?(.github)
private func instagramAction() {
openURL?(.instagram)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -119,19 +119,6 @@ final class TokensViewEmptyListScreen: UIView {
headerStackView.addArrangedSubviews([iconImage, headerLabel])
buttonsStackView.addArrangedSubviews([pairNewServiceButton, importButton])

addSubview(helpButton, with: [
helpButton.topAnchor.constraint(
greaterThanOrEqualTo: mainStackView.bottomAnchor,
constant: Theme.Metrics.standardMargin
),
helpButton.centerXAnchor.constraint(equalTo: centerXAnchor),
helpButton.widthAnchor.constraint(equalToConstant: Theme.Metrics.componentWidth),
helpButton.bottomAnchor.constraint(
lessThanOrEqualTo: safeBottomAnchor,
constant: -Theme.Metrics.standardMargin
)
])

pairNewServiceButton.action = { [weak self] in self?.pairNewService?() }
importButton.action = { [weak self] in self?.importFromExternalService?() }
helpButton.action = { [weak self] in self?.help?() }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,20 +128,6 @@ extension TokensViewController: TokensViewControlling {

// MARK: - Navibar icons
func updateAddIcon(using state: TokensViewControllerAddState) {
func createNewsIcon() -> UIBarButtonItem {
let img: UIImage = {
presenter.hasUnreadNews ? Asset.navibarNewsIconBadge.image : Asset.navibarNewsIcon.image
}()
img.withTintColor(Theme.Colors.Icon.theme)
let button = UIBarButtonItem(
image: img,
style: .plain,
target: self,
action: #selector(showNotifications)
)
button.accessibilityLabel = T.Commons.notifications
return button
}

func createAddButton(image: UIImage) -> UIBarButtonItem {
let buttonAdd = UIBarButtonItem(
Expand All @@ -158,12 +144,10 @@ extension TokensViewController: TokensViewControlling {
case .firstTime:
navigationItem.rightBarButtonItems = [
createAddButton(image: Asset.naviIconAddFirst.image),
createNewsIcon()
]
case .normal:
navigationItem.rightBarButtonItems = [
createAddButton(image: Asset.naviIconAdd.image),
createNewsIcon()
]
case .none:
let buttonSection = UIBarButtonItem(
Expand Down
2 changes: 2 additions & 0 deletions TwoFAS/TwoFASAuth/Generated/T.generated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -1214,6 +1214,8 @@ internal enum T {
internal static let twitter = T.tr("Localizable", "social__twitter", fallback: "X (formerly Twitter)")
/// YouTube
internal static let youtube = T.tr("Localizable", "social__youtube", fallback: "YouTube")
/// Instagram
internal static let instagram = T.tr("Localizable", "social__instagram", fallback: "Instagram")
}
internal enum Tokens {
/// Point your camera at the screen to capture the QR code.
Expand Down

0 comments on commit 71dd889

Please sign in to comment.