| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155 |
- import {
- useEffect,
- useLayoutEffect
- } from "react";
- import {
- Image,
- View
- } from "react-native";
- import stylesheet from "./stylesheet";
- import {
- NCoreUIKitLocalize,
- NCoreUIKitTheme,
- PaletteSwitcher,
- NCoreUIKitMenu,
- PageContainer,
- ThemeSwitcher,
- AvatarGroup,
- RowCard,
- Button,
- Avatar,
- Text
- } from "ncore-ui-kit";
- import {
- useNavigation
- } from "@react-navigation/native";
- import type RootStackParamList from "../../navigation/type";
- import type {
- NativeStackNavigationProp
- } from "@react-navigation/native-stack";
- import {
- ChevronRight
- } from "lucide-react-native";
- import packageJSON from "../../../../package.json";
- const Home = () => {
- const {
- colors,
- spaces
- } = NCoreUIKitTheme.useContext();
- const {
- localize
- } = NCoreUIKitLocalize.useContext();
- const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
- useEffect(() => {
- NCoreUIKitMenu.load({
- buttons: [{
- title: "Ana Sayfa"
- }],
- id: "test"
- });
- }, []);
- useLayoutEffect(() => {
- navigation.setOptions({
- headerShown: false
- });
- }, []);
- return <PageContainer
- scrollViewStyle={stylesheet.container}
- isScrollable={true}
- scrollViewProps={{
- showsHorizontalScrollIndicator: false,
- showsVerticalScrollIndicator: false,
- contentContainerStyle: {
- backgroundColor: colors.content.container.default,
- ...stylesheet.contentContainer
- }
- }}
- >
- <Button
- title="Open Menu"
- onPress={() => {
- NCoreUIKitMenu.open({
- id: "test"
- });
- }}
- />
- <PaletteSwitcher/>
- <ThemeSwitcher/>
- <View
- style={{
- justifyContent: "center",
- alignItems: "center",
- maxWidth: 850,
- width: "100%"
- }}
- >
- <Image
- source={{
- uri: "https://ncore.nibgat.space/assets/images/ncorelogo.png"
- }}
- style={{
- height: 300,
- width: 300
- }}
- />
- <Text
- variant="displayMediumSize"
- style={{
- marginBottom: spaces.spacingMd,
- textAlign: "center"
- }}
- >
- {localize("ncore-design-system")}
- </Text>
- <Text
- variant="headlineLargeSize"
- style={{
- marginBottom: spaces.spacingLg,
- textAlign: "center"
- }}
- >
- {localize("ui-kit-library")}
- </Text>
- <Text
- variant="bodyLargeSize"
- style={{
- marginBottom: spaces.spacingMd,
- textAlign: "center"
- }}
- >
- {localize("ncore-about")}
- </Text>
- <Text
- color="low"
- style={{
- marginBottom: spaces.spacingMd
- }}
- >
- {localize("version")}: {packageJSON.version}
- </Text>
- <RowCard
- title={localize("text")}
- rightIcon={({
- customColor,
- color,
- size
- }) => {
- return <ChevronRight
- color={customColor ? customColor : colors.content.icon[color]}
- size={size}
- />;
- }}
- onPress={() => {
- navigation.navigate("TextPage");
- }}
- />
- </View>
- </PageContainer>;
- };
- export default Home;
|