-
Notifications
You must be signed in to change notification settings - Fork 90
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add archive and unarchive actions. Add predefined channel queries and…
… action sheet for selecting different queries
- Loading branch information
Showing
10 changed files
with
200 additions
and
38 deletions.
There are no files selected for viewing
File renamed without changes.
File renamed without changes.
26 changes: 26 additions & 0 deletions
26
DemoAppSwiftUI/ChannelHeader/ChannelListQueryIdentifier.swift
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,26 @@ | ||
// | ||
// Copyright © 2024 Stream.io Inc. All rights reserved. | ||
// | ||
|
||
import Foundation | ||
import StreamChat | ||
|
||
enum ChannelListQueryIdentifier: String, CaseIterable, Identifiable { | ||
case initial | ||
case archived | ||
case pinned | ||
case unarchivedAndPinnedSorted | ||
|
||
var id: String { | ||
rawValue | ||
} | ||
|
||
var title: String { | ||
switch self { | ||
case .initial: "Initial Channels" | ||
case .archived: "Archived Channels" | ||
case .pinned: "Pinned Channels" | ||
case .unarchivedAndPinnedSorted: "Sort by Pinned and Ignore Archived Channels" | ||
} | ||
} | ||
} |
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,21 @@ | ||
// | ||
// Copyright © 2024 Stream.io Inc. All rights reserved. | ||
// | ||
|
||
import StreamChat | ||
import StreamChatSwiftUI | ||
import SwiftUI | ||
|
||
struct ChooseChannelQueryView: View { | ||
static let queryIdentifiers = ChannelListQueryIdentifier.allCases.sorted(using: KeyPathComparator(\.title)) | ||
|
||
var body: some View { | ||
ForEach(Self.queryIdentifiers) { queryIdentifier in | ||
Button { | ||
AppState.shared.setChannelQueryIdentifier(queryIdentifier) | ||
} label: { | ||
Text(queryIdentifier.title) | ||
} | ||
} | ||
} | ||
} |
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
File renamed without changes.
File renamed without changes.
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