-
-
Notifications
You must be signed in to change notification settings - Fork 166
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement sorting blocked users and communities
- Loading branch information
1 parent
aac888e
commit 5cdb42d
Showing
4 changed files
with
46 additions
and
33 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { IonLabel, IonSegment, IonSegmentButton } from "@ionic/react"; | ||
|
||
import { SortOptionType } from "./Types"; | ||
|
||
|
||
type BlockedEntitiesSorterProps = { | ||
sortOption: SortOptionType; | ||
setSortOption: (value: SortOptionType) => void; | ||
}; | ||
|
||
const BlockedEntititiesSorter: React.FC<BlockedEntitiesSorterProps> = ({ sortOption, setSortOption }) => { | ||
|
||
return ( | ||
<IonSegment | ||
value={sortOption} | ||
onIonChange={e => { | ||
setSortOption(e.detail.value as 'default' | 'alphabetical'); | ||
console.log("Sort option changed to:", e.detail.value); | ||
}} | ||
> | ||
<IonSegmentButton value="default"> | ||
<IonLabel>Most Recent</IonLabel> | ||
</IonSegmentButton> | ||
<IonSegmentButton value="alphabetical"> | ||
<IonLabel>Alphabetical</IonLabel> | ||
</IonSegmentButton> | ||
</IonSegment> | ||
) | ||
|
||
} | ||
|
||
export default BlockedEntititiesSorter |
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,3 @@ | ||
export type SortOptionType = 'default' | 'alphabetical'; | ||
|
||
export type SortCriterion = 'name' | 'alphabetical'; |