commit 917be067c4970896c2c18082e7d87977850a8483
Author: Fantič <58391275+FantaFantic@users.noreply.github.com>
Date:   Mon May 8 12:36:01 2023 +0200

    re #10569: NotesView: Sort menu, NotesView page preparation

diff --git a/src/pages/NotesViewPage.tsx b/src/pages/NotesViewPage.tsx
new file mode 100644
index 0000000..2c04fed
--- /dev/null
+++ b/src/pages/NotesViewPage.tsx
@@ -0,0 +1,119 @@
+import React, { useEffect, useState } from "react"
+import { log } from "../logging/logger"
+import { DrawerScreenProps } from "@react-navigation/drawer"
+import { RootDrawerParamList } from "../components/Navigation"
+import { Box, Button, ChevronDownIcon, ChevronLeftIcon, ChevronRightIcon, ChevronUpIcon, FormControl, HStack, Heading, Input, MinusIcon, Popover, ScrollView, Switch, Text, VStack } from "native-base"
+import { SortOptions } from "../types/general"
+import { current } from "@reduxjs/toolkit"
+
+const NotesViewPage = ({ route, navigation }: DrawerScreenProps<RootDrawerParamList, 'Notes'>) => {
+
+  const [isSortOpen, setIsSortOpen] = useState(false);
+
+  const [myCommentsCheck, setMyCommentsCheck] = useState(false);
+  const [generalCommentsCheck, setGeneralCommentsCheck] = useState(true);
+
+
+  const [sortSettings, setSortSettings] = useState({
+    items: SortOptions.None,
+    date: SortOptions.None
+  });
+
+  const handleSortChanged = (key: "items" | "date") => {
+    let currentState = sortSettings[key];
+    if (currentState == SortOptions.None) {
+      setSortSettings({
+        ...sortSettings,
+        [key]: SortOptions.Asc
+      })
+    }
+    else if (currentState == SortOptions.Asc) {
+      setSortSettings({
+        ...sortSettings,
+        [key]: SortOptions.Desc
+      })
+    }
+    else {
+      setSortSettings({
+        ...sortSettings,
+        [key]: SortOptions.None
+      })
+    }
+  }
+
+  const getSortIcon = (sortOption: SortOptions, size: string) => {
+    switch (sortOption) {
+      case SortOptions.Asc:
+        return <ChevronUpIcon size={size} />;
+      case SortOptions.Desc:
+        return <ChevronDownIcon size={size} />;
+      default:
+        return <MinusIcon size={size} />;
+    }
+  };
+
+  const getNotes = () => {
+    console.log("Get NOTES");
+  }
+
+  return (
+    <ScrollView flex="1">
+      <Box width="90%" marginLeft="5%">
+        <VStack>
+          <HStack marginTop="5%">
+
+            <Box width="30%">
+              <Popover // @ts-ignore
+                trigger={triggerProps => {
+                  return <Button colorScheme="primary" {...triggerProps} onPress={() => setIsSortOpen(true)}>
+                    Sort Options
+                  </Button>;
+                }} isOpen={isSortOpen} onClose={() => setIsSortOpen(!isSortOpen)}>
+                <Popover.Content w="48">
+                  <Popover.Arrow />
+                  <Popover.CloseButton onPress={() => setIsSortOpen(false)} />
+                  <Popover.Header>Sort Options</Popover.Header>
+                  <Popover.Body>
+                    <VStack>
+                      <Button size="md" variant="outline" onPress={() => handleSortChanged("items")}
+                        rightIcon={getSortIcon(sortSettings.items, "sm")}
+                      >
+                        Items</Button>
+                      <Button size="md" variant="outline" marginTop={"5%"} onPress={() => handleSortChanged("date")}
+                        rightIcon={getSortIcon(sortSettings.date, "sm")}>
+                        Date</Button>
+                    </VStack>
+                  </Popover.Body>
+                  <Popover.Footer justifyContent="flex-end">
+                    <Button.Group space={2}>
+                      <Button colorScheme="coolGray" variant="ghost" onPress={() => setIsSortOpen(false)}>
+                        Cancel
+                      </Button>
+                      <Button colorScheme="success" onPress={() => { setIsSortOpen(false); getNotes() }}>
+                        Save
+                      </Button>
+                    </Button.Group>
+                  </Popover.Footer>
+                </Popover.Content>
+              </Popover>
+            </Box>
+            <VStack width="20%">
+              <HStack >
+                <Text>My comments</Text>
+                <Switch isChecked={myCommentsCheck} onValueChange={setMyCommentsCheck} size="md" />
+              </HStack>
+              <HStack >
+                <Text>General comments</Text>
+                <Switch isChecked={generalCommentsCheck} onValueChange={setGeneralCommentsCheck} size="md" />
+              </HStack>
+            </VStack>
+          </HStack>
+
+        </VStack>
+      </Box>
+    </ScrollView>
+
+  );
+}
+
+export default NotesViewPage;
diff --git a/src/types/general.ts b/src/types/general.ts
index e69de29..74d1bc3 100644
--- a/src/types/general.ts
+++ b/src/types/general.ts
@@ -0,0 +1,5 @@
+export enum SortOptions {
+    None = "none",
+    Asc = "asc",
+    Desc = "desc"
+  }
\ No newline at end of file
