Projekt

Obecné

Profil

Stáhnout (2.67 KB) Statistiky
| Větev: | Tag: | Revize:
1 5c86e446 mschwob
import { Center, Box, Heading, VStack, FormControl, Link, Input, Button, HStack, Text } from "native-base"
2 7e4b4e6a mschwob
import { axiosInstance } from "../api/api"
3
4
let text: number = 199
5
const fakeLogin = async () => {
6 5c86e446 mschwob
    text = 101
7 7e4b4e6a mschwob
    axiosInstance.post(
8 5c86e446 mschwob
        '/api/login/',
9 7e4b4e6a mschwob
        {"username": "viktorie", "password": "Golem123."}
10
    ).then((response) => {
11
        text = response.status
12 5c86e446 mschwob
        console.log(response)
13
    })
14
}
15
16
const fakeRequest = async () => {
17
    text = 101
18
    console.log("request")
19
    axiosInstance.get(
20
        '/api/users'
21
    ).then((response) => {
22
        text = response.status
23
        console.log(response)
24 7e4b4e6a mschwob
    })
25
}
26
const LoginPage = () => {
27
    return (
28 5c86e446 mschwob
        <Center w="100%">
29
            <Box safeArea p="2" py="8" w="90%" maxW="290">
30
                <Heading size="lg" fontWeight="600" color="coolGray.800" _dark={{
31
                    color: "warmGray.50"
32
                }}>
33
                    Welcome
34
                </Heading>
35
                <Heading mt="1" _dark={{
36
                    color: "warmGray.200"
37
                }} color="coolGray.600" fontWeight="medium" size="xs">
38
                    Sign in to continue!
39
                </Heading>
40
41
                <VStack space={3} mt="5">
42
                    <FormControl>
43
                        <FormControl.Label>Email ID</FormControl.Label>
44
                        <Input />
45
                    </FormControl>
46
                    <FormControl>
47
                        <FormControl.Label>Password</FormControl.Label>
48
                        <Input type="password" />
49
                        <Link _text={{
50
                            fontSize: "xs",
51
                            fontWeight: "500",
52
                            color: "indigo.500"
53
                        }} alignSelf="flex-end" mt="1">
54
                            Forget Password?
55
                        </Link>
56
                    </FormControl>
57
                    <Button mt="2" colorScheme="indigo">
58
                        Sign in
59
                    </Button>
60
                    <HStack mt="6" justifyContent="center">
61
                        <Text fontSize="sm" color="coolGray.600" _dark={{
62
                            color: "warmGray.200"
63
                        }}>
64
                            I'm a new user.{" "}
65
                        </Text>
66
                        <Link _text={{
67
                            color: "indigo.500",
68
                            fontWeight: "medium",
69
                            fontSize: "sm"
70
                        }} href="#">
71
                            Sign Up
72
                        </Link>
73
                    </HStack>
74
                </VStack>
75
            </Box>
76
        </Center>
77
    )
78 7e4b4e6a mschwob
}
79
80
export default LoginPage