Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Site Design Revamp] Main View - Remove the filter bar #18501

Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FilterableCategoriesViewController: CollapsableHeaderViewController {
debounceSelectionChange.call()
}
}
private let filterBar: CollapsableHeaderFilterBar
private let filterBar: CollapsableHeaderFilterBar?

internal var categorySections: [CategorySection] { get {
fatalError("This should be overridden by the subclass to provide a conforming collection of categories")
Expand Down Expand Up @@ -57,14 +57,15 @@ class FilterableCategoriesViewController: CollapsableHeaderViewController {
prompt: String? = nil,
primaryActionTitle: String,
secondaryActionTitle: String? = nil,
defaultActionTitle: String? = nil
defaultActionTitle: String? = nil,
showsFilterBar: Bool = true
) {
self.analyticsLocation = analyticsLocation
tableView = UITableView(frame: .zero, style: .plain)
tableView.separatorStyle = .singleLine
tableView.separatorInset = .zero
tableView.showsVerticalScrollIndicator = false
filterBar = CollapsableHeaderFilterBar()
filterBar = showsFilterBar ? CollapsableHeaderFilterBar() : nil
super.init(scrollableView: tableView,
mainTitle: mainTitle,
prompt: prompt,
Expand All @@ -81,7 +82,7 @@ class FilterableCategoriesViewController: CollapsableHeaderViewController {
override func viewDidLoad() {
super.viewDidLoad()
tableView.register(CategorySectionTableViewCell.nib, forCellReuseIdentifier: CategorySectionTableViewCell.cellReuseIdentifier)
filterBar.filterDelegate = self
filterBar?.filterDelegate = self
tableView.dataSource = self
configureCloseButton()
}
Expand All @@ -102,9 +103,9 @@ class FilterableCategoriesViewController: CollapsableHeaderViewController {
}

public func loadingStateChanged(_ isLoading: Bool) {
filterBar.shouldShowGhostContent = isLoading
filterBar.allowsMultipleSelection = !isLoading
filterBar.reloadData()
filterBar?.shouldShowGhostContent = isLoading
filterBar?.allowsMultipleSelection = !isLoading
filterBar?.reloadData()
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,8 @@ class SiteDesignContentCollectionViewController: FilterableCategoriesViewControl
analyticsLocation: "site_creation",
mainTitle: TextContent.mainTitle,
primaryActionTitle: createsSite ? TextContent.createSiteButton : TextContent.chooseButton,
secondaryActionTitle: TextContent.previewButton
secondaryActionTitle: TextContent.previewButton,
showsFilterBar: false
)
}

Expand Down