Projekt

Obecné

Profil

« Předchozí | Další » 

Revize f22a2126

Přidáno uživatelem Michal Schwob před více než 1 rok

FIX: colors fix
re #10896

Zobrazit rozdíly:

src/components/item/ItemTabBar.tsx
1
import { HStack, CircleIcon, View, ScrollView, Button, Center, Heading, Pressable, Text, Box, Container, VStack, Icon, ArrowBackIcon, ChevronLeftIcon, ChevronRightIcon, useToast, Divider } from "native-base";
1
import { HStack, CircleIcon, ScrollView, Pressable, Text, VStack, useToast, Divider } from "native-base";
2 2
import { CertaintyWithColors } from "../../stores/reducers/itemSlice";
3 3
import { Certainty, Concordance } from "../../types/item";
4 4
import LoadingBox from "../loading/LoadingBox";
......
74 74
                    </HStack>
75 75
                </HStack>
76 76
            </HStack> */
77
            <HStack h="16" backgroundColor={"#F5F4F1"}>
77
            <HStack h="16" backgroundColor={"primary.100"}>
78 78
                <ScrollView contentContainerStyle={{ flexGrow: 1 }} flex="1" horizontal={true}>
79 79
                    {concordances && concordances.length > 0 &&
80 80
                        <HStack flex="1" justifyContent="center" width="100%">
......
87 87
                                                    size="2"
88 88
                                                    color={CertaintyWithColors[concordances?.[i]?.cert ?? Certainty.Unknown].color}
89 89
                                                />}
90
                                                <Text marginLeft={2} color={i == index ? "#654B07" : "#8F6A0A"} bold fontSize={"md"}>
90
                                                <Text marginLeft={2} color={i == index ? "primary.500" : "primary.300"} bold fontSize={"md"}>
91 91
                                                    {concordances?.[i]?.id}
92 92
                                                </Text>
93 93
                                            </HStack>
94
                                            {i == index && <Divider color="primary" borderWidth={2} borderRadius={5} width={85} mt={5} />}
94
                                            {i == index && <Divider outlineColor={"primary.500"} borderWidth={2} borderRadius={5} width={85} mt={5} />}
95 95
                                        </VStack>
96 96

  
97 97
                                    </Pressable>
......
105 105
                                                size="2"
106 106
                                                color={CertaintyWithColors[concordances?.[0]?.cert ?? Certainty.Unknown].color}
107 107
                                            />}
108
                                            <Text marginLeft={2} color={0 == 0 ? "#654B07" : "#8F6A0A"} bold fontSize={"md"}>
108
                                            <Text marginLeft={2} color={"primary.500"} bold fontSize={"md"}>
109 109
                                                {concordances?.[0]?.id}
110 110
                                            </Text>
111 111
                                        </HStack>
112
                                        {0 == 0 && <Divider color="#654B07" borderWidth={2} borderRadius={5} width={85} mt={5} />}
112
                                        {0 == 0 && <Divider color="primary.500" borderWidth={2} borderRadius={5} width={85} mt={5} />}
113 113
                                    </VStack>
114 114

  
115 115
                                </Pressable>
src/components/item/ItemView.tsx
16 16
import { RootStackParamList } from "../../pages/Navigation"
17 17
import { select } from "d3"
18 18
import { CertaintyWithColors } from "../../stores/reducers/itemSlice"
19
import RenderHTML from "react-native-render-html"
19 20

  
20 21
interface ItemDetailProps {
21 22
    item: Item,
......
49 50
                        <VStack>
50 51
                            <HStack marginLeft={2.5} alignItems={"center"}>
51 52
                                <VStack flex={1} marginTop={3.5}>
52
                                    <Text fontSize={13} color="#4D4D4D">
53
                                    <Text fontSize={13} fontWeight={"light"}>
53 54
                                        {item.authorDisplayName ? item.authorDisplayName : item.authorName}
54 55
                                    </Text>
55
                                    <Heading marginTop={1} fontSize={18} color="#4D4D4D">
56
                                    <Heading marginTop={1} fontSize={18}>
56 57
                                        {item.workName}
57 58
                                    </Heading>
58 59

  
59 60
                                </VStack>
60 61
                                <Box marginLeft="auto" marginTop={0}> {/* marginLeft: "auto" pushes the Box to the right */}
61
                                    <Button variant="outline" backgroundColor={"#F4DFAB"} borderRadius={8} size="sm" padding={1.5} >
62
                                        <Text color="#654B07" fontSize={14}>
62
                                    <Button variant="outline" backgroundColor={"secondary.500"} borderRadius={8} size="sm" padding={1.5} >
63
                                        <Text color="primary.500" fontSize={14}>
63 64
                                            {item?.concordances?.[0]?.id}
64 65
                                        </Text>
65 66
                                    </Button>
......
69 70

  
70 71

  
71 72

  
72
                            <View marginTop={5} backgroundColor="#F5F4F1" borderRadius={10} borderColor="#F5F4F1" padding={2}>
73
                            <View marginTop={5} backgroundColor="primary.100" borderRadius={10} borderColor="primary.100" padding={2}>
73 74
                                {item.inventoryItem &&
74 75
                                    <VStack>
75 76
                                        <Text italic>
76
                                            <Text color="#654B07" italic fontWeight={"semibold"}>Inventory item: </Text>
77
                                            <Text color="primary.500" italic fontWeight={"semibold"}>Inventory item: </Text>
77 78
                                            {item.inventoryItem}
78 79
                                        </Text>
79
                                        <Text italic marginTop="2.5%">
80
                                        <Text italic marginTop="2">
80 81
                                            {item.searchSubjects != undefined && item?.searchSubjects?.map((subject, index) => (
81 82
                                                subject != "" ?
82 83
                                                    item.searchSubjects && index < item.searchSubjects.length - 1 ? (subject + ", ") : (subject)
......
87 88
                                    </VStack>}
88 89
                            </View>
89 90
                            {item.fullView && item.images && item.images.length > 0 && (
90
                                <VStack marginTop={5} alignItems="center" justifyContent="center" backgroundColor="#F5F4F1" borderRadius={10} borderColor="#F5F4F1" padding={2}>
91
                                <VStack marginTop={5} alignItems="center" justifyContent="center" backgroundColor="primary.100" borderRadius={10} borderColor="primary.100" padding={2}>
91 92

  
92 93
                                    <Box style={{ backgroundColor: item.images[selectedImage].relationship_type != RelationshipType.IdentifiedArtwork ? "#B3B3B3" : CertaintyWithColors[item.images[selectedImage].cert ?? Certainty.Unknown].color }}
93 94
                                        marginTop={2.5} width={Dimensions.get('window').width - 110} alignItems="center" borderTopRadius={10} >
......
131 132
                                </VStack>
132 133
                            )}
133 134
                            {item.fullView && (
134
                                <View marginTop={5} backgroundColor="#F5F4F1" borderRadius={10} borderColor="#F5F4F1" padding={2} marginBottom={5}>
135
                                <View marginTop={5} backgroundColor="primary.100" borderRadius={10} borderColor="primary.100" padding={2} marginBottom={5}>
135 136
                                    {item.authorName &&
136 137
                                        <HStack>
137 138
                                            <Text marginTop={2.5}>
138
                                                <Text color="#654B07" italic fontWeight={"semibold"}>Author name: </Text>
139
                                                <Text color="primary.500" italic fontWeight={"semibold"}>Author name: </Text>
139 140
                                                {item.images?.[selectedImage]?.author}
140 141
                                            </Text>
141 142
                                        </HStack>}
142 143
                                    {item.title &&
143 144
                                        <HStack>
144 145
                                            <Text marginTop={2.5}>
145
                                                <Text color="#654B07" italic fontWeight={"semibold"}>Title: </Text>
146
                                                <Text color="primary.500" italic fontWeight={"semibold"}>Title: </Text>
146 147
                                                {item.images?.[selectedImage].title}
147 148
                                            </Text>
148 149
                                        </HStack>}
149 150
                                    {item.institution &&
150 151
                                        <HStack>
151 152
                                            <Text marginTop={2.5}>
152
                                                <Text color="#654B07" italic fontWeight={"semibold"}>Institution: </Text>
153
                                                <Text color="primary.500" italic fontWeight={"semibold"}>Institution: </Text>
153 154
                                                {item.images?.[selectedImage].institution.name && `${item.images?.[selectedImage].institution.name}`}
154 155
                                                {item.images?.[selectedImage].institution.inventoryNumber && `, Inv. No. ${item.images?.[selectedImage].institution.inventoryNumber}`}
155 156
                                                {item.images?.[selectedImage].institution.city && `, ${item.images?.[selectedImage].institution.city}`}
......
159 160
                                    {item.repository &&
160 161
                                        <HStack>
161 162
                                            <Text marginTop={2.5}>
162
                                                <Text color="#654B07" italic fontWeight={"semibold"}>Repository: </Text>
163
                                                <Text color="primary.500" italic fontWeight={"semibold"}>Repository: </Text>
163 164
                                                {item.images?.[selectedImage].repository}
164 165
                                            </Text>
165 166
                                        </HStack>}
166 167
                                    {item.images?.[selectedImage].provenance &&
167 168
                                        <HStack>
168 169
                                            <Text marginTop={2.5}>
169
                                                <Text color="#654B07" italic fontWeight={"semibold"}>Provenance: </Text>
170
                                                <Text color="primary.500" italic fontWeight={"semibold"}>Provenance: </Text>
170 171
                                                {item.images?.[selectedImage].provenance}
171 172
                                            </Text>
172 173
                                        </HStack>}
173 174
                                    {item.images?.[selectedImage].description &&
174 175
                                        <HStack>
175 176
                                            <Text marginTop={2.5}>
176
                                                <Text color="#654B07" italic fontWeight={"semibold"}>Description: </Text>
177
                                                {item.images?.[selectedImage].description}
177
                                                <Text color="primary.500" italic fontWeight={"semibold"}>Description: </Text>
178 178
                                            </Text>
179
                                            <RenderHTML contentWidth={200} source={{html: item.images?.[selectedImage].description}} />
179 180
                                        </HStack>}
180 181
                                </View>)}
181 182

  
......
185 186
                                    <Button
186 187
                                        onPress={() => props.navigation.navigate("Plan", { roomId: item?.room?.id, placeId: undefined })}
187 188
                                        variant={"link"}
188
                                        backgroundColor={"#F4DFAB"}
189
                                        backgroundColor={"secondary.500"}
189 190
                                        borderRadius={7}
190 191
                                        marginTop={0}
191 192
                                        marginBottom={5}
......
254 255
            :
255 256
            (<VStack>
256 257
                <Flex direction="row" align="flex-start" justifyContent="space-between" marginTop={2.5} marginLeft={2.5} marginRight={2.5}>
257
                    <Text fontWeight="semibold" mt={4} ml={2} fontSize="md" color="#4D4D4D">Show related comments</Text>
258
                    <Text fontWeight="semibold" mt={4} ml={2} fontSize="md" >Show related comments</Text>
258 259
                    <Switch value={showRelatedComments} onChange={toggleRelatedComments} size="lg" marginRight={2} />
259 260
                </Flex>
260 261
                <Box >
src/components/notes/NoteView.tsx
1
import { HStack, Box, Text, Image, VStack, Flex, Pressable, DeleteIcon, Button, Center, Avatar, TextArea, AlertDialog, ScrollView } from "native-base";
1
import {
2
    HStack,
3
    Box,
4
    Text,
5
    Image,
6
    VStack,
7
    Flex,
8
    Pressable,
9
    DeleteIcon,
10
    Button,
11
    Center,
12
    Avatar,
13
    TextArea,
14
    AlertDialog,
15
    ScrollView,
16
    KeyboardAvoidingView
17
} from "native-base";
2 18
import { Note } from "../../types/note";
3 19
import { EditIcon } from "../general/Icons";
4 20
import { AVATAR_URL } from "../../api/constants";
5 21
import { useState } from "react";
6 22
import React from "react";
7 23
import NotesListView from "./NotesListView";
24
import {Platform} from "react-native"
8 25

  
9 26
const NoteView = React.memo((props: { note: Note, handleReply: any, handleDelete: any, handleEdit: any, setConfirmDialog: any, navigation: any, parentId?: string, higlighted?: boolean }) => {
10 27
    const note = props.note;
......
83 100
    }
84 101

  
85 102
    return (
86
        <HStack style={props.higlighted && { backgroundColor: "#FFF8E1", borderBottomColor: '#FFD54F', borderBottomWidth: 1.5, paddingBottom: 10 }} marginTop={5}>
103

  
104
        <HStack backgroundColor={props.higlighted ? "secondary.50" : "white"} borderBottomColor={props.higlighted ? "secondary.800" : ""}
105
                borderBottomWidth={props.higlighted ? 1.5 : 0} paddingBottom={props.higlighted ? 10 : 0} marginTop={5}>
87 106
            <Box width="12" height="12" marginTop="2">
88 107
                <Avatar bg={note.noteColor} width={10} height={10} source={{
89 108
                    uri: AVATAR_URL + "/" + note.avatarUrl
......
100 119
                    {note.username}
101 120
                </Text>
102 121

  
103
                <Text italic color="#8F8F8F" fontSize="xs">
122
                <Text italic color="trueGray.500" fontSize="xs">
104 123
                    {getDateString(note.createdTime)}
105 124
                </Text>
106 125

  
......
116 135

  
117 136
                    {note.items && note.items.length > 0 &&
118 137
                        <Flex marginLeft={1} flex={0}>
119
                            <Button p={1} variant="solid" backgroundColor="#F4DFAB" borderRadius={8} size="sm" onPress={() => props.navigation.navigate("Item", { itemId: note.items[0] })}>
120
                                <Text color="#654B07" fontSize={12}>
138
                            <Button p={1} variant="solid" backgroundColor="secondary.500" borderRadius={8} size="sm" onPress={() => props.navigation.navigate("Item", { itemId: note.items[0] })}>
139
                                <Text color="primary.500" fontSize={12}>
121 140
                                    {note.items[0]}
122 141
                                </Text>
123 142
                            </Button>
......
132 151
                    <Flex direction="row" alignItems="center">
133 152
                        {props.handleReply != null &&
134 153
                            <Pressable onPress={() => props.handleReply(note.uuid, note.username)}>
135
                                <Text color="#8F8F8F">Reply</Text>
154
                                <Text color="trueGray.500">Reply</Text>
136 155
                            </Pressable>}
137 156
                        {!props.parentId && note.replies && note.replies.length > 0 &&
138 157
                            <Pressable marginLeft={3} onPress={() => toggleShowReplies()}>
139 158
                                {!showReplies ?
140
                                    <Text color="#8F8F8F">{note.replies.length} replies</Text>
159
                                    <Text color="trueGray.500">{note.replies.length} replies</Text>
141 160
                                    :
142
                                    <Text color="#8F8F8F">Hide</Text>
161
                                    <Text color="trueGray.500">Hide</Text>
143 162
                                }
144 163

  
145 164
                            </Pressable>}
......
150 169
                            isEdited &&
151 170
                            <>
152 171
                                < Pressable onPress={saveEdit} marginRight={5}>
153
                                    <Text color="#8F8F8F">Save</Text>
172
                                    <Text color="trueGray.500">Save</Text>
154 173
                                </Pressable>
155 174
                                <Pressable onPress={toggleEdited} marginRight={6}>
156
                                    <Text color="#8F8F8F">Cancel</Text>
175
                                    <Text color="trueGray.500">Cancel</Text>
157 176
                                </Pressable>
158 177
                            </>}
159 178
                        {props.handleEdit &&
160 179
                            !isEdited &&
161 180
                            <Pressable onPress={toggleEdited} marginRight={5}>
162
                                <EditIcon color="#8F8F8F" />
181
                                <EditIcon color="trueGray.500" />
163 182
                            </Pressable>}
164 183
                        {props.handleDelete &&
165 184
                            <Pressable onPress={deleteClicked}>
src/components/notes/NotesListView.tsx
1
import { VStack, Box, Text, HStack, ScrollView, Flex, Button, CloseIcon, IconButton, TextArea, useToast } from "native-base";
1
import {
2
    VStack,
3
    Box,
4
    Text,
5
    HStack,
6
    ScrollView,
7
    Flex,
8
    Button,
9
    CloseIcon,
10
    IconButton,
11
    TextArea,
12
    useToast,
13
    KeyboardAvoidingView
14
} from "native-base";
2 15
import { Note } from "../../types/note";
3 16
import NoteView from "./NoteView";
4 17
import { MessageIcon } from "../general/Icons";
......
99 112
    };
100 113

  
101 114
    return (
115
        <KeyboardAvoidingView
116
            h={ {lg: "auto"} }
117
            behavior={ "padding" }
118
            keyboardVerticalOffset={ 600 }
119
            mb={ 2 }
120
        >
102 121
        <VStack >
103 122
            <Box height={props.height - (replyingTo ? 40 : 0) ?? undefined} marginBottom={2}>
104 123
                {/* Notes */}
......
146 165

  
147 166
                    {/* Replying to */}
148 167
                    {replyingTo != null &&
149
                        <Flex direction="row" alignItems="center" justify="flex-end" height={10} style={{ backgroundColor: "#FFF8E1" }}>
168
                        <Flex direction="row" alignItems="center" justify="flex-end" height={10} backgroundColor={"secondary.50"}>
150 169
                            <Text>Replying to {replyingTo.userName}</Text>
151
                            <IconButton onPress={() => setReplyingTo(null)} size="sm" icon={<CloseIcon />} marginLeft="-1%" marginRight={20} />
170
                            <IconButton onPress={() => setReplyingTo(null)} size="sm" icon={<CloseIcon />} marginLeft={-1} marginRight={20} />
152 171
                        </Flex>
153 172
                    }
154 173

  
......
174 193
            }
175 194
            <ConfirmDialog {...confirmDialog} isShown={confirmDialog != null} cancelRef={cancelRef} />
176 195
        </VStack >
196
        </KeyboardAvoidingView>
177 197
    );
178 198
}
179 199

  
src/components/plan/CastlePlanView.tsx
291 291
            borderWidth={fullScreenMode ? 0 : 1}
292 292
        >
293 293
            {/* control panel */}
294
            <Flex direction="row" alignItems="center" justify="flex-end" style={{ height: 50, width: 100, top: fullScreenMode ? 10 : 0, right: fullScreenMode ? 20 : 15, position: "absolute", zIndex: 5 }}>
295
                <Pressable padding={1.5} backgroundColor={"#654B07"} borderRadius={5} marginRight={selectedRoom ? 1 : -2} onPress={handleFullScreenPressed}>
294
            <Flex direction="row" alignItems="center" justify="flex-end" style={{ height: 50, width: 100, top: fullScreenMode ? 30 : 0, right: fullScreenMode ? 20 : 15, position: "absolute", zIndex: 5 }}>
295
                <Pressable padding={1.5} backgroundColor={"primary.500"} borderRadius={5} marginRight={selectedRoom ? 1 : -2} onPress={handleFullScreenPressed}>
296 296
                    <FullscreenIcon color="white" />
297 297
                </Pressable>
298 298
                {
299 299
                    selectedRoom &&
300
                    <Pressable padding={1.5} backgroundColor={"#654B07"} borderRadius={5} marginRight={-2} onPress={() => { zoomToRoom(selectedRoom) }}>
300
                    <Pressable padding={1.5} backgroundColor={"primary.500"} borderRadius={5} marginRight={-2} onPress={() => { zoomToRoom(selectedRoom) }}>
301 301
                        <ExitfullscreenIcon color="white" />
302 302
                    </Pressable>
303 303
                }
......
354 354
                                            <Path
355 355
                                                id={"roomList_" + index.toString()}
356 356
                                                d={room.svg_path}  // The path data defining the shape of the room
357
                                                fill={selectedRoom && room.id == selectedRoom.id ? "#E6F7FF" : "white"}        // Fill the room shape with no color
357
                                                fill={selectedRoom && room.id == selectedRoom.id ? "primary.100" : "white"}        // Fill the room shape with no color
358 358
                                                stroke="#66B2FF"       // Outline color
359
                                                strokeWidth={0.3}     // Outline width
359
                                                strokeWidth={1.0}     // Outline width
360 360
                                                fillOpacity={selectedRoom && room.id == selectedRoom.id ? 1 : 0.2}
361 361
                                            />
362 362
                                        )
src/pages/NotesViewPage.tsx
1 1
import React, { useCallback, useEffect, useState } from "react"
2 2
import { log } from "../logging/logger"
3 3
import { DrawerScreenProps } from "@react-navigation/drawer"
4
import { Box, Button, ChevronDownIcon, ChevronUpIcon, Flex, HStack, MinusIcon, Popover, Switch, Text, VStack, useToast } from "native-base"
4
import {
5
  Box,
6
  Button,
7
  ChevronDownIcon,
8
  ChevronUpIcon,
9
  Flex,
10
  HStack,
11
  MinusIcon,
12
  Popover,
13
  Switch,
14
  Text,
15
  VStack,
16
  useToast,
17
  KeyboardAvoidingView
18
} from "native-base"
5 19
import { SortOptions } from "../types/general"
6 20
import { Note } from "../types/note"
7 21
import NotesListView from "../components/notes/NotesListView"
......
13 27
import { ErrorToast } from "../components/toast/ErrorToast"
14 28
import { InfoToast } from "../components/toast/InfoToast"
15 29

  
16
import { Dimensions } from "react-native";
30
import {Dimensions, Platform} from "react-native";
17 31

  
18 32
const NotesViewPage = ({ navigation }: DrawerScreenProps<RootStackParamList, 'Notes'>) => {
19 33

  
......
143 157

  
144 158

  
145 159
  return (
146
    <Box>
147
      <VStack>
148
        <Flex direction="row" align="flex-start" justifyContent="space-between" marginTop={1} marginLeft={2.5} marginRight={2.5}>
149
          <Text fontWeight="semibold" mt={3} ml={2} fontSize="md" color="#4D4D4D">General comments</Text>
150
          <Switch isChecked={generalCommentsCheck} onValueChange={() => { if (!notesLoading) setGeneralCommentsCheck(!generalCommentsCheck) }} size="lg" marginRight={2} />
151
        </Flex>
152
        <Flex direction="row" align="flex-start" justifyContent="space-between" marginTop={-1} marginLeft={2.5} marginRight={2.5}>
153
          <Text fontWeight="semibold" mt={3} ml={2} fontSize="md" color="#4D4D4D">My comments</Text>
154
          <Switch padding={0} isChecked={myCommentsCheck} onValueChange={() => { if (!notesLoading) setMyCommentsCheck(!myCommentsCheck) }} size="lg" marginRight={2} />
155
        </Flex>
156
        <Popover // @ts-ignore
157
          trigger={triggerProps => {
158
            return <Button marginLeft={4} marginBottom={2} width={150} backgroundColor="#F4DFAB" {...triggerProps} onPress={() => setIsSortOpen(true)}
159
              borderRadius={7}
160
              rightIcon={(sortSettings.date != SortOptions.None || sortSettings.items != SortOptions.None) ? (getSortIcon(sortSettings.date != SortOptions.None ? sortSettings.date : sortSettings.items, "xs", "#654B07")) : undefined}
161
            >
162
              <Text fontSize={14} color="#654B07">
163
                Sort {(sortSettings.date != SortOptions.None || sortSettings.items != SortOptions.None) ? (sortSettings.date != SortOptions.None ? "by date" : "by items") : ""}
164
              </Text>
165
            </Button>;
166
          }} isOpen={isSortOpen} onClose={() => setIsSortOpen(!isSortOpen)}>
167
          <Popover.Content w="48">
168
            <Popover.Arrow />
169
            <Popover.CloseButton onPress={() => setIsSortOpen(false)} />
170
            <Popover.Header><Text fontSize={"md"} color="#654B07">Sort Options</Text></Popover.Header>
171
            <Popover.Body>
172
              <VStack>
173
                <Button size="md" variant="outline" onPress={() => handleSortChanged("items", sortSettings)}
174
                  rightIcon={getSortIcon(sortSettings.items, "sm", "#654B07")}
160

  
161
        <Box>
162
          <VStack>
163
            <Flex direction="row" align="flex-start" justifyContent="space-between" marginTop={1} marginLeft={2.5} marginRight={2.5}>
164
              <Text fontWeight="semibold" mt={3} ml={2} fontSize="md" color="primary.500">General comments</Text>
165
              <Switch isChecked={generalCommentsCheck} onValueChange={() => { if (!notesLoading) setGeneralCommentsCheck(!generalCommentsCheck) }} size="md" marginRight={2} />
166
            </Flex>
167
            <Flex direction="row" align="flex-start" justifyContent="space-between" marginTop={0} marginLeft={2.5} marginRight={2.5}>
168
              <Text fontWeight="semibold" mt={3} ml={2} fontSize="md" color="primary.500" >My comments</Text>
169
              <Switch padding={0} isChecked={myCommentsCheck} onValueChange={() => { if (!notesLoading) setMyCommentsCheck(!myCommentsCheck) }} size="md" marginRight={2} />
170
            </Flex>
171
            <Popover // @ts-ignore
172
              trigger={triggerProps => {
173
                return <Button marginLeft={4} marginBottom={2} width={150} backgroundColor="secondary.500" {...triggerProps} onPress={() => setIsSortOpen(true)}
174
                  borderRadius={7}
175
                  rightIcon={(sortSettings.date != SortOptions.None || sortSettings.items != SortOptions.None) ? (getSortIcon(sortSettings.date != SortOptions.None ? sortSettings.date : sortSettings.items, "xs", "primary.500")) : undefined}
175 176
                >
176
                  Items</Button>
177
                <Button size="md" variant="outline" marginTop={"5%"} onPress={() => handleSortChanged("date", sortSettings)}
178
                  rightIcon={getSortIcon(sortSettings.date, "sm", "#654B07")}>
179
                  Date</Button>
180
              </VStack>
181
            </Popover.Body>
182
            <Popover.Footer justifyContent="flex-end">
183
              <Button.Group space={2}>
184
                <Button colorScheme="coolGray" variant="ghost" onPress={() => setIsSortOpen(false)}>
185
                  Cancel
186
                </Button>
187
                <Button backgroundColor={"#F4DFAB"} onPress={() => { setIsSortOpen(false); getNotes() }}>
188
                  <Text color="#654B07">
189
                    Save
177
                  <Text fontSize={14} color="primary.500">
178
                    Sort {(sortSettings.date != SortOptions.None || sortSettings.items != SortOptions.None) ? (sortSettings.date != SortOptions.None ? "by date" : "by items") : ""}
190 179
                  </Text>
191
                </Button>
192
              </Button.Group>
193
            </Popover.Footer>
194
          </Popover.Content>
195
        </Popover>
196
        {
197
          notesLoading ? (
198
            <LoadingBox text="Loading notes" />
199
          )
200
            :
201
            (<NotesListView height={Dimensions.get('window').height - 307} notes={notes} navigation={navigation} handleCreateComment={handleCreateComment} requestPending={requestPending} />)
202
        }
203

  
204

  
205
      </VStack>
206
    </Box>
180
                </Button>;
181
              }} isOpen={isSortOpen} onClose={() => setIsSortOpen(!isSortOpen)}>
182
              <Popover.Content w="48">
183
                <Popover.Arrow />
184
                <Popover.CloseButton onPress={() => setIsSortOpen(false)} />
185
                <Popover.Header><Text fontSize={"md"} color="primary.500">Sort Options</Text></Popover.Header>
186
                <Popover.Body>
187
                  <VStack>
188
                    <Button size="md" variant="outline" onPress={() => handleSortChanged("items", sortSettings)}
189
                      rightIcon={getSortIcon(sortSettings.items, "sm", "primary.500")}
190
                    >
191
                      Items</Button>
192
                    <Button size="md" variant="outline" marginTop={"5%"} onPress={() => handleSortChanged("date", sortSettings)}
193
                      rightIcon={getSortIcon(sortSettings.date, "sm", "primary.500")}>
194
                      Date</Button>
195
                  </VStack>
196
                </Popover.Body>
197
                <Popover.Footer justifyContent="flex-end">
198
                  <Button.Group space={2}>
199
                    <Button colorScheme="coolGray" variant="ghost" onPress={() => setIsSortOpen(false)}>
200
                      Cancel
201
                    </Button>
202
                    <Button backgroundColor={"secondary.500"} onPress={() => { setIsSortOpen(false); getNotes() }}>
203
                      <Text color="primary.500">
204
                        Save
205
                      </Text>
206
                    </Button>
207
                  </Button.Group>
208
                </Popover.Footer>
209
              </Popover.Content>
210
            </Popover>
211
            {
212
              notesLoading ? (
213
                <LoadingBox text="Loading notes" />
214
              )
215
                :
216
                (<NotesListView height={Dimensions.get('window').height - 400} notes={notes} navigation={navigation} handleCreateComment={handleCreateComment} requestPending={requestPending} />)
217
            }
218

  
219

  
220
          </VStack>
221
        </Box>
207 222
  );
208 223
}
209 224

  
src/pages/PlanViewPage.tsx
277 277
                        }
278 278

  
279 279
                      }}
280
                      backgroundColor={"#654B07"}
280
                      backgroundColor={"primary.500"}
281 281
                      variant="subtle"
282 282
                      borderRadius={10}
283 283
                      size={"sm"}

Také k dispozici: Unified diff