index.tsx 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109
  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. Text
  14. } from "ncore-ui-kit";
  15. import {
  16. useNavigation
  17. } from "@react-navigation/native";
  18. import type RootStackParamList from "../../navigation/type";
  19. import type {
  20. NativeStackNavigationProp
  21. } from "@react-navigation/native-stack";
  22. import packageJSON from "../../../../package.json";
  23. const Home = () => {
  24. const {
  25. colors,
  26. spaces
  27. } = NCoreUIKitTheme.useContext();
  28. const {
  29. localize
  30. } = NCoreUIKitLocalize.useContext();
  31. const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
  32. useLayoutEffect(() => {
  33. navigation.setOptions({
  34. headerShown: false
  35. });
  36. }, []);
  37. return <PageContainer
  38. scrollViewStyle={stylesheet.container}
  39. isScrollable={true}
  40. scrollViewProps={{
  41. showsHorizontalScrollIndicator: false,
  42. showsVerticalScrollIndicator: false,
  43. contentContainerStyle: {
  44. backgroundColor: colors.content.container.default,
  45. ...stylesheet.contentContainer
  46. }
  47. }}
  48. >
  49. <View
  50. style={{
  51. justifyContent: "center",
  52. alignItems: "center",
  53. maxWidth: 850,
  54. width: "100%"
  55. }}
  56. >
  57. <Image
  58. source={{
  59. uri: "https://ncore.nibgat.space/assets/images/ncorelogo.png"
  60. }}
  61. style={{
  62. height: 300,
  63. width: 300
  64. }}
  65. />
  66. <Text
  67. variant="displayMediumSize"
  68. style={{
  69. marginBottom: spaces.spacingMd,
  70. textAlign: "center"
  71. }}
  72. >
  73. {localize("ncore-design-system")}
  74. </Text>
  75. <Text
  76. variant="headlineLargeSize"
  77. style={{
  78. marginBottom: spaces.spacingLg,
  79. textAlign: "center"
  80. }}
  81. >
  82. {localize("ui-kit-library")}
  83. </Text>
  84. <Text
  85. variant="bodyLargeSize"
  86. style={{
  87. marginBottom: spaces.spacingMd,
  88. textAlign: "center"
  89. }}
  90. >
  91. {localize("ncore-about")}
  92. </Text>
  93. <Text
  94. color="low"
  95. style={{
  96. marginBottom: spaces.spacingMd
  97. }}
  98. >
  99. {localize("version")}: {packageJSON.version}
  100. </Text>
  101. </View>
  102. </PageContainer>;
  103. };
  104. export default Home;