index.tsx 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  1. import {
  2. useLayoutEffect
  3. } from "react";
  4. import {
  5. Image,
  6. View
  7. } from "react-native";
  8. import stylesheet from "./stylesheet";
  9. import {
  10. NCoreUIKitLocalize,
  11. NCoreUIKitTheme,
  12. PageContainer,
  13. RowCard,
  14. Text
  15. } from "ncore-ui-kit";
  16. import {
  17. useNavigation
  18. } from "@react-navigation/native";
  19. import type RootStackParamList from "../../navigation/type";
  20. import type {
  21. NativeStackNavigationProp
  22. } from "@react-navigation/native-stack";
  23. import {
  24. ChevronRight
  25. } from "lucide-react-native";
  26. import packageJSON from "../../../../package.json";
  27. const Home = () => {
  28. const {
  29. colors,
  30. spaces
  31. } = NCoreUIKitTheme.useContext();
  32. const {
  33. localize
  34. } = NCoreUIKitLocalize.useContext();
  35. const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
  36. useLayoutEffect(() => {
  37. navigation.setOptions({
  38. headerShown: false
  39. });
  40. }, []);
  41. return <PageContainer
  42. scrollViewStyle={stylesheet.container}
  43. isScrollable={true}
  44. scrollViewProps={{
  45. showsHorizontalScrollIndicator: false,
  46. showsVerticalScrollIndicator: false,
  47. contentContainerStyle: {
  48. backgroundColor: colors.content.container.default,
  49. ...stylesheet.contentContainer
  50. }
  51. }}
  52. >
  53. <View
  54. style={{
  55. justifyContent: "center",
  56. alignItems: "center",
  57. maxWidth: 850,
  58. width: "100%"
  59. }}
  60. >
  61. <Image
  62. source={{
  63. uri: "https://ncore.nibgat.space/assets/images/ncorelogo.png"
  64. }}
  65. style={{
  66. height: 300,
  67. width: 300
  68. }}
  69. />
  70. <Text
  71. variant="displayMediumSize"
  72. style={{
  73. marginBottom: spaces.spacingMd,
  74. textAlign: "center"
  75. }}
  76. >
  77. {localize("ncore-design-system")}
  78. </Text>
  79. <Text
  80. variant="headlineLargeSize"
  81. style={{
  82. marginBottom: spaces.spacingLg,
  83. textAlign: "center"
  84. }}
  85. >
  86. {localize("ui-kit-library")}
  87. </Text>
  88. <Text
  89. variant="bodyLargeSize"
  90. style={{
  91. marginBottom: spaces.spacingMd,
  92. textAlign: "center"
  93. }}
  94. >
  95. {localize("ncore-about")}
  96. </Text>
  97. <Text
  98. color="low"
  99. style={{
  100. marginBottom: spaces.spacingMd
  101. }}
  102. >
  103. {localize("version")}: {packageJSON.version}
  104. </Text>
  105. <RowCard
  106. title={localize("text")}
  107. rightIcon={({
  108. customColor,
  109. color,
  110. size
  111. }) => {
  112. return <ChevronRight
  113. color={customColor ? customColor : colors.content.icon[color]}
  114. size={size}
  115. />;
  116. }}
  117. onPress={() => {
  118. navigation.navigate("TextPage");
  119. }}
  120. />
  121. </View>
  122. </PageContainer>;
  123. };
  124. export default Home;