katoikia-app/mobile-ui/App.js

127 lines
3.0 KiB
JavaScript
Raw Normal View History

2022-08-04 07:22:41 +00:00
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";
2022-07-18 20:54:08 +00:00
2022-08-04 07:22:41 +00:00
// Define the config
const config = {
useSystemColorMode: false,
initialColorMode: "dark",
};
2022-07-18 20:54:08 +00:00
2022-08-04 07:22:41 +00:00
// extend the theme
export const theme = extendTheme({ config });
2022-07-18 20:54:08 +00:00
2022-08-04 07:22:41 +00:00
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>
2022-07-18 20:54:08 +00:00
2022-08-04 07:22:41 +00:00
<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>
);
2022-07-18 20:54:08 +00:00
}
2022-08-04 07:22:41 +00:00
// 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"
}
2022-07-18 20:54:08 +00:00
/>
2022-08-04 07:22:41 +00:00
<Text>Light</Text>
</HStack>
);
2022-07-18 20:54:08 +00:00
}