katoikia-app/mobile-ui/App.js

127 lines
3.0 KiB
JavaScript

import React from "react";
import {
Text,
Link,
HStack,
Center,
Heading,
Switch,
useColorMode,
NativeBaseProvider,
extendTheme,
VStack,
Box,
FormControl,
Input,
Button,
} from "native-base";
import NativeBaseIcon from "./components/NativeBaseIcon";
import { Platform } from "react-native";
// Define the config
const config = {
useSystemColorMode: false,
initialColorMode: "dark",
};
// extend the theme
export const theme = extendTheme({ config });
export default function App() {
return (
<NativeBaseProvider>
<Center w="100%">
<Box safeArea p="2" py="8" w="90%" maxW="290">
<Heading
size="lg"
fontWeight="600"
color="coolGray.800"
_dark={{
color: "warmGray.50",
}}
>
Welcome To Katoikia
</Heading>
<Heading
mt="1"
_dark={{
color: "warmGray.200",
}}
color="coolGray.600"
fontWeight="medium"
size="xs"
>
Sign in to continue!
</Heading>
<VStack space={3} mt="5">
<FormControl>
<FormControl.Label> Email ID</FormControl.Label>
<Input />
</FormControl>
<FormControl>
<FormControl.Label> Password </FormControl.Label>
<Input type="password" />
<Link
_text={{
fontSize: "xs",
fontWeight: "500",
color: "indigo.500",
}}
alignSelf="flex-end"
mt="1"
>
Forget Password?
</Link>
</FormControl>
<Button mt="2" colorScheme="indigo">
<Text>Sign in </Text>
</Button>
<HStack mt="6" justifyContent="center">
<Text
fontSize="sm"
color="coolGray.600"
_dark={{
color: "warmGray.200",
}}
>
I'm a new user.
</Text>
<Link
_text={{
color: "indigo.500",
fontWeight: "medium",
fontSize: "sm",
}}
href="#"
>
Sign Up
</Link>
</HStack>
</VStack>
</Box>
</Center>
</NativeBaseProvider>
);
}
// Color Switch Component
function ToggleDarkMode() {
const { colorMode, toggleColorMode } = useColorMode();
return (
<HStack space={2} alignItems="center">
<Text>Dark</Text>
<Switch
isChecked={colorMode === "light"}
onToggle={toggleColorMode}
aria-label={
colorMode === "light" ? "switch to dark mode" : "switch to light mode"
}
/>
<Text>Light</Text>
</HStack>
);
}