Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 67b916af

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

#re 10797 LoadingBox refactor size

Zobrazit rozdíly:

src/components/loading/LoadingBox.tsx
1
import { HStack, Heading, Spinner } from "native-base"
1
import { Box, HStack, Heading, Spinner } from "native-base"
2 2
import React from "react"
3 3

  
4 4

  
......
10 10
    const { text } = props
11 11

  
12 12
    return (
13
        <HStack alignItems="center" flex="1" justifyContent="center">
14
            <Spinner/>
15
            <Heading color="primary.400" fontSize="md">
16
                {text}
17
            </Heading>
18
        </HStack>
13
        <Box width="100%" marginTop="20" height="8">
14
            <HStack alignItems="center" flex="1" justifyContent="center">
15
                <Spinner />
16
                <Heading color="primary.400" fontSize="md">
17
                    {text}
18
                </Heading>
19
            </HStack>
20
        </Box>
19 21
    )
20 22
}
21 23

  
src/pages/Logout.tsx
3 3
import { AppDispatch } from "../stores/store"
4 4
import { Center, Heading, HStack, Spinner } from "native-base"
5 5
import { logout } from "../stores/actions/userThunks"
6
import LoadingBox from "../components/loading/LoadingBox"
6 7

  
7 8
const Logout = () => {
8 9
    const dispatch = useDispatch<AppDispatch>();
......
12 13
    }, [])
13 14

  
14 15
    return (
15
        <Center justifyContent={"center"}>
16
            <HStack space={2} justifyContent="center">
17
                <Spinner
18
                    accessibilityLabel="Loading logout"
19
                    color="primary.500"
20
                />
21
                <Heading color="primary.500" fontSize="md">
22
                    Loading
23
                </Heading>
24
            </HStack>
25
        </Center>
16
        <LoadingBox text="Logging out..."/>
26 17
    )
27 18
}
28 19

  
src/pages/NotesViewPage.tsx
82 82
    }));
83 83
  }
84 84

  
85
  const handleCreateComment = (newComment : string, replyingTo : { messageId: string; userName: string } | null) => {
85
  const handleCreateComment = (newComment: string, replyingTo: { messageId: string; userName: string } | null) => {
86 86

  
87 87
    console.log(newComment, replyingTo)
88 88

  
......
152 152
            </Flex>
153 153
          </VStack>
154 154
        </HStack>
155
        {
156
          notesLoading ? (<LoadingBox text="Loading notes" />)
157
            :
158
            (<NotesListView notes={notes} navigation={navigation} handleCreateComment={handleCreateComment} requestPending={requestPending} />)
159
        }
155
        <Box>
156
          {
157
            notesLoading ? (
158
              <LoadingBox text="Loading notes" />
159
            )
160
              :
161
              (<NotesListView notes={notes} navigation={navigation} handleCreateComment={handleCreateComment} requestPending={requestPending} />)
162
          }
163
        </Box>
164

  
160 165

  
161 166
      </VStack>
162 167
    </Box>

Také k dispozici: Unified diff