Revize 760dd761
Přidáno uživatelem Fantič před více než 1 rok
src/pages/NotesViewPage.tsx | ||
---|---|---|
10 | 10 |
import LoadingBox from "../components/loading/LoadingBox" |
11 | 11 |
import { createNote, getAllNotes } from "../stores/actions/notesThunks" |
12 | 12 |
import { RootDrawerParamList } from "./Navigation" |
13 |
import { Dimensions } from "react-native" |
|
13 |
|
|
14 | 14 |
const NotesViewPage = ({ navigation }: DrawerScreenProps<RootDrawerParamList, 'Notes'>) => { |
15 | 15 |
|
16 | 16 |
const { notes, notesLoading, requestPending, triggerRefresh } = useSelector((state: RootState) => state.noteViewState) |
... | ... | |
27 | 27 |
date: SortOptions.None |
28 | 28 |
}); |
29 | 29 |
|
30 |
const handleSortChanged = useCallback((key: "items" | "date") => { |
|
30 |
const handleSortChanged = useCallback((key: "items" | "date", sortSettings: any) => {
|
|
31 | 31 |
let currentState = sortSettings[key]; |
32 | 32 |
if (currentState == SortOptions.None) { |
33 | 33 |
setSortSettings({ |
... | ... | |
120 | 120 |
<Popover.Header>Sort Options</Popover.Header> |
121 | 121 |
<Popover.Body> |
122 | 122 |
<VStack> |
123 |
<Button size="md" variant="outline" onPress={() => handleSortChanged("items")} |
|
123 |
<Button size="md" variant="outline" onPress={() => handleSortChanged("items", sortSettings)}
|
|
124 | 124 |
rightIcon={getSortIcon(sortSettings.items, "sm")} |
125 | 125 |
> |
126 | 126 |
Items</Button> |
127 |
<Button size="md" variant="outline" marginTop={"5%"} onPress={() => handleSortChanged("date")} |
|
127 |
<Button size="md" variant="outline" marginTop={"5%"} onPress={() => handleSortChanged("date", sortSettings)}
|
|
128 | 128 |
rightIcon={getSortIcon(sortSettings.date, "sm")}> |
129 | 129 |
Date</Button> |
130 | 130 |
</VStack> |
Také k dispozici: Unified diff
#re 10797 NotesViewPage fix SortSettings changed