Projekt

Obecné

Profil

« Předchozí | Další » 

Revize 000ecc2f

Přidáno uživatelem Schwobik před téměř 2 roky(ů)

adding redux for user state management and testing loading images

Zobrazit rozdíly:

src/pages/ScrollViewTest.tsx
1
import { Center, Box, Heading, VStack, FormControl, Link, Input, Button, HStack, Text, ScrollView } from "native-base"
1
import {
2
    Center,
3
    Box,
4
    Heading,
5
    VStack,
6
    FormControl,
7
    Link,
8
    Input,
9
    Button,
10
    HStack,
11
    Text,
12
    ScrollView,
13
    Image
14
} from "native-base"
2 15
import { axiosInstance } from "../api/api"
3 16

  
4 17

  
5 18

  
6 19
const ScrollViewTest = () => {
7
    const colors = ["red.200", "orange.200", "yellow.200", "green.200", "teal.200", "blue.200", "cyan.200", "purple.200", "pink.200"]
20
    const images = ["VieB-7.jpg", "VieB-10.jpg", "VieB-11.jpg", "VieB-14.jpg", "VieB-15.jpg"]
8 21

  
9 22
    return (
10 23
        <ScrollView>
......
57 70
                    </VStack>
58 71
                </Box>
59 72
                <ScrollView horizontal={true}>
60
                    {colors.map((color, index) => (
61
                        <Box
62
                            key={index}
63
                            bg={color}
64
                            w="150"
65
                            h="150"
66
                            marginX={5}
67
                        >
68
                        </Box>
73
                    {images.map((name, index) => (
74
                        <Image
75
                            source={{uri: "http://147.228.173.159/static/images/"+name}}
76
                            w={150}
77
                            h={150}
78
                            marginX={2}
79
                            alt={name}
80
                        />
69 81
                    ))}
70 82
                </ScrollView>
83

  
71 84
            </Center>
72 85
        </ScrollView>
73 86
    )

Také k dispozici: Unified diff