Skip to content
This repository has been archived by the owner on Dec 15, 2020. It is now read-only.

Commit

Permalink
Disable Website link in the side bar (#66)
Browse files Browse the repository at this point in the history
  • Loading branch information
Joshua Liebowitz committed Dec 3, 2019
1 parent 1d82842 commit d7cd810
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 9 deletions.
19 changes: 13 additions & 6 deletions ScienceJournal/UI/AboutViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,17 @@ class AboutViewController: MaterialHeaderCollectionViewController {
// MARK: - Data model

enum AboutRow {
case website
// Website is changing, so hide this option for now.
// case website
case licenses
case version
case privacy
case terms

var title: String {
switch self {
case .website: return String.settingsWebsiteTitle
// Website is changing, so hide this option for now.
// case .website: return String.settingsWebsiteTitle
case .licenses: return String.settingsOpenSourceTitle
case .version: return String.settingsVersionTitle
case .privacy: return String.settingsPrivacyPolicyTitle
Expand All @@ -42,7 +44,8 @@ class AboutViewController: MaterialHeaderCollectionViewController {

var description: String? {
switch self {
case .website: return "https://g.co/sciencejournal"
// Website is changing, so hide this option for now.
// case .website: return ""
case .licenses: return nil
case .version: return Bundle.appVersionString
case .privacy: return "https://www.google.com/policies/privacy/"
Expand All @@ -52,7 +55,8 @@ class AboutViewController: MaterialHeaderCollectionViewController {

var accessibilityLabel: String {
switch self {
case .website: return String.settingsWebsiteTitle
// Website is changing, so hide this option for now.
// case .website: return String.settingsWebsiteTitle
case .licenses: return String.settingsOpenSourceTitle
case .version: return "\(String.settingsVersionTitle) \(self.description ?? "")"
case .privacy: return String.settingsPrivacyPolicyTitle
Expand Down Expand Up @@ -82,7 +86,8 @@ class AboutViewController: MaterialHeaderCollectionViewController {
// MARK: - Datasource

let rows: [AboutRow] = [
.website,
// Disable website for now, since location is likely changing.
// .website,
.licenses,
.version,
.privacy,
Expand Down Expand Up @@ -166,7 +171,9 @@ class AboutViewController: MaterialHeaderCollectionViewController {
didSelectItemAt indexPath: IndexPath) {
let rowData = rows[indexPath.row]
switch rowData {
case .website, .privacy, .terms:
// Website is changing, so hide this option for now.
// case .website, .privacy, .terms:
case .privacy, .terms:
if let stringURL = rowData.description, let url = URL(string: stringURL) {
UIApplication.shared.open(url)
}
Expand Down
3 changes: 2 additions & 1 deletion ScienceJournal/UI/SidebarViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,8 @@ class SidebarViewController: UIViewController, UICollectionViewDelegate, UIColle

let menuStructure: [SidebarRow] = [
.experiments,
.website,
// Website is changing, so hide this option for now.
// .website,
.settings,
.feedback,
.about
Expand Down
3 changes: 1 addition & 2 deletions ScienceJournal/UI/UserFlowViewController.swift
Original file line number Diff line number Diff line change
Expand Up @@ -387,8 +387,7 @@ class UserFlowViewController: UIViewController, ExperimentsListViewControllerDel
aboutNavController.modalPresentationStyle = .formSheet
present(aboutNavController, animated: true)
case .website:
let websiteURL =
"https://makingscience.withgoogle.com/science-journal/activities?utm_source=app"
let websiteURL = "new url here"
guard let url = URL(string: websiteURL) else { return }
UIApplication.shared.open(url)
case .settings:
Expand Down

0 comments on commit d7cd810

Please sign in to comment.