commit ca53e9f158fd654fb42a603b4759f7b4529cf4f5
Author: Schwobik <michal.schwob@seznam.cz>
Date:   Tue Apr 18 23:17:59 2023 +0200

    Demo of listview implemented
    re #10342

diff --git a/src/api/searchService.ts b/src/api/searchService.ts
index 45f14c2..b57884a 100644
--- a/src/api/searchService.ts
+++ b/src/api/searchService.ts
@@ -6,5 +6,5 @@ export interface SearchParams {
 }
 
 export const searchRequest = async (params: SearchParams) => {
-    return await axiosInstance.get(`/api/search_v2/${ (params.inventory ? `inventory=${ params.inventory }` : "")}`)
+    return await axiosInstance.get(`/search_v2${ (params.inventory ? `?inventory=${ params.inventory }` : "")}`)
 }
\ No newline at end of file
diff --git a/src/components/listView/ItemPreview.tsx b/src/components/listView/ItemPreview.tsx
index dd800ae..6b5233b 100644
--- a/src/components/listView/ItemPreview.tsx
+++ b/src/components/listView/ItemPreview.tsx
@@ -1,19 +1,33 @@
-import { Center } from "native-base"
+import { Center, HStack, Image, Text, VStack } from "native-base"
 
 interface ItemPreviewProps {
     caption: string
     title: string
-    name: string
-    image: string
+    name?: string
+    image?: string
 }
 
 const ItemPreview = (props: ItemPreviewProps) => {
 
     return (
         <>
-            <Center>
 
-            </Center>
+            <HStack
+                space={ 2 }
+                flex={ 1 }
+                alignItems={ "start" }
+            >
+                <Image
+                    source={ {uri: `http:/147.228.173.159/static/images/${ props.image ? props.image : "thumb-Rel-78.png" }`} }
+                    size={ "sm" }
+                    alt={ props.image ? props.image : "thumb-Rel-78.png" }
+                />
+                <VStack>
+                    <Text>{ props.name }</Text>
+                    <Text>{ props.caption }</Text>
+                    <Text>{ props.title }</Text>
+                </VStack>
+            </HStack>
         </>
     )
 }
diff --git a/src/components/listView/ListView.tsx b/src/components/listView/ListView.tsx
index 2388bf3..d02c496 100644
--- a/src/components/listView/ListView.tsx
+++ b/src/components/listView/ListView.tsx
@@ -1,15 +1,36 @@
 import { useEffect, useState } from "react"
-import { Text } from "native-base"
+import { ScrollView, Text, VStack } from "native-base"
 import { useSelector } from "react-redux"
 import { RootState } from "../../stores/store"
+import ItemPreview from "./ItemPreview"
 
 const ListView = () => {
     const items = useSelector((state: RootState) => state.listView.data)
 
     return (
-        <>
-            <Text>ListView</Text>
-        </>
+        <VStack
+            space={ 2 }
+            flex={ 1 }
+            p={ 4 }
+            alignItems={ "start" }
+        >
+            { items.map((item) => (
+                <ItemPreview
+                    caption={ item.object[0].caption }
+                    title={ item.text }
+                    name={
+                        item.object[0].name ?
+                            item.object[0].name[0].getty_data ?
+                                item.object[0].name[0].getty_data.display_name
+                                :
+                                item.object[0].name[0].value
+                            :
+                            undefined
+                    }
+                    image={ item.object[1] && item.object[1].images && item.object[1].images ? item.object[1].images[0].file : undefined }
+                />
+            )) }
+        </VStack>
     )
 }
 
diff --git a/src/components/search/SearchForm.tsx b/src/components/search/SearchForm.tsx
index af84cca..dba305d 100644
--- a/src/components/search/SearchForm.tsx
+++ b/src/components/search/SearchForm.tsx
@@ -50,7 +50,6 @@ const SearchForm = () => {
 
 
     const searchSubmit = () => {
-        console.log("search")
         dispatch(search({inventory: selectedInventories ? selectedInventories[0] : undefined}))
     }
 
diff --git a/src/pages/LoginPage.tsx b/src/pages/LoginPage.tsx
index 12eb4b4..75c82f5 100644
--- a/src/pages/LoginPage.tsx
+++ b/src/pages/LoginPage.tsx
@@ -80,27 +80,27 @@ const LoginPage = () => {
                             <FormControl.Label>Username</FormControl.Label>
                             <Input
                                 // value={username}
+                                textContentType={"username"}
+                                autoComplete={"username"}
+                                onSubmitEditing={ () => { loginUser() } }
                                 onChangeText={ (username) => setUsername(username) }
                             />
                         </FormControl>
                         <FormControl>
                             <FormControl.Label>Password</FormControl.Label>
-                            <Input type="password"
-                                // value={password}
-                                   onChangeText={ (password) => setPassword(password) }
+                            <Input
+                                type="password"
+                                autoComplete={ "password" }
+                                id={ "password" }
+                                returnKeyType={ "done" }
+                                onSubmitEditing={ () => loginUser() }
+                                onChangeText={ (password) => setPassword(password) }
                             />
-                            <Link _text={ {
-                                fontSize: "xs",
-                                fontWeight: "500",
-                                color: "indigo.500"
-                            } } alignSelf="flex-end" mt="1">
-                                Forget Password?
-                            </Link>
                         </FormControl>
                         <Button
                             mt="2"
                             colorScheme="indigo"
-                            onPress={ () => loginUser() }
+                            onPress={ loginUser }
                         >
                             Sign in
                         </Button>
diff --git a/src/pages/SearchPage.tsx b/src/pages/SearchPage.tsx
index 835d2de..6dfb5c1 100644
--- a/src/pages/SearchPage.tsx
+++ b/src/pages/SearchPage.tsx
@@ -1,4 +1,4 @@
-import { Center, KeyboardAvoidingView, Text } from "native-base"
+import { Center, KeyboardAvoidingView, ScrollView, Text, VStack } from "native-base"
 import ListView from "../components/listView/ListView"
 import SearchForm from "../components/search/SearchForm"
 import { Platform } from "react-native"
@@ -8,15 +8,16 @@ const SearchPage = () => {
     return (
         <KeyboardAvoidingView
             h={ {
-                base: "400px",
                 lg: "auto"
             } }
             behavior={ Platform.OS === "ios" ? "padding" : "height" }
         >
-            <Center>
-                <SearchForm/>
-                <ListView/>
-            </Center>
+            <ScrollView>
+                <VStack>
+                    <SearchForm/>
+                    <ListView/>
+                </VStack>
+            </ScrollView>
         </KeyboardAvoidingView>
     )
 }
diff --git a/src/types/listViewTypes.ts b/src/types/listViewTypes.ts
index e8bd234..a5f0014 100644
--- a/src/types/listViewTypes.ts
+++ b/src/types/listViewTypes.ts
@@ -23,14 +23,17 @@ export type ItemPreview = {
     src?: ItemSource
 }
 
-export type Item = {
-    caption: string
-    type: string
-    name?: PersonName[]
-    images?: ItemImage[]
-    origDate?: string
-
-}
+export type Item = [
+    {
+        caption: string
+        type: string
+        name?: PersonName[]
+    },
+    {
+        images?: ItemImage[]
+        origDate?: string
+    }
+]
 
 export type PersonName = {
     value?: string
