Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 293f99f8

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

re #10819 ItemView notes: notesListView height refactor

Zobrazit rozdíly:

src/pages/NotesViewPage.tsx
11 11
import { createNote, getAllNotes } from "../stores/actions/notesThunks"
12 12
import { RootDrawerParamList } from "./Navigation"
13 13
import { ErrorToast } from "../components/toast/ErrorToast"
14
import { InfoToast } from "../components/toast/InfoToast"
15

  
16
import { Dimensions } from "react-native";
14 17

  
15 18
const NotesViewPage = ({ navigation }: DrawerScreenProps<RootDrawerParamList, 'Notes'>) => {
16 19

  
17
  const { notes, notesLoading, requestPending, triggerRefresh } = useSelector((state: RootState) => state.noteViewState)
20
  const { notes, notesLoading, requestPending, triggerRefresh } = useSelector((state: RootState) => state.noteViewState);
18 21

  
19 22
  const dispatch = useDispatch<AppDispatch>();
20 23

  
......
107 110

  
108 111
    if (!requestPending) {
109 112
      // creating new comment
113
      toast.show({
114
        render: ({
115
            id
116
        }) => {
117
            return <InfoToast  text={"Adding note"} onClose={() => toast.close(id)} />;
118
        },
119
        duration: 2000
120
    });
110 121
      if (replyingTo != null) {
111 122
        dispatch(createNote({
112 123
          newNote: { note: newComment, reply_to: replyingTo.messageId } as Note
......
178 189
            <LoadingBox text="Loading notes" />
179 190
          )
180 191
            :
181
            (<NotesListView notes={notes} navigation={navigation} handleCreateComment={handleCreateComment} requestPending={requestPending} />)
192
            (<NotesListView height={Dimensions.get('window').height - 70 - 160} notes={notes} navigation={navigation} handleCreateComment={handleCreateComment} requestPending={requestPending} />)
182 193
        }
183 194

  
184 195

  

Také k dispozici: Unified diff