index.tsx 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148
  1. import {
  2. useLayoutEffect
  3. } from "react";
  4. import {
  5. View
  6. } from "react-native";
  7. import {
  8. NCoreUIKitLocalize,
  9. NCoreUIKitTheme,
  10. PageContainer,
  11. CodeViewer,
  12. Button,
  13. Header,
  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. ChevronRightIcon
  25. } from "lucide-react-native";
  26. const Installation = () => {
  27. const {
  28. colors,
  29. spaces
  30. } = NCoreUIKitTheme.useContext();
  31. const {
  32. localize
  33. } = NCoreUIKitLocalize.useContext();
  34. const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
  35. useLayoutEffect(() => {
  36. navigation.setOptions({
  37. header: () => (
  38. <Header
  39. title={localize("installation-title")}
  40. isWrapSafeareaContext={false}
  41. navigation={navigation}
  42. isGoBackEnable={true}
  43. />
  44. ),
  45. headerShown: true
  46. });
  47. }, []);
  48. return (
  49. <PageContainer
  50. isWorkWithHeaderSpace={false}
  51. isScrollable={true}
  52. >
  53. <View
  54. style={{
  55. padding: spaces.spacingMd,
  56. width: "100%"
  57. }}
  58. >
  59. <Text
  60. variant="bodyMediumSize"
  61. color="mid"
  62. style={{
  63. marginBottom: spaces.spacingMd
  64. }}
  65. >
  66. {localize("installation-desc")}
  67. </Text>
  68. <View
  69. style={{
  70. backgroundColor: colors.content.container.default,
  71. borderColor: colors.content.border.subtle,
  72. borderRadius: 10,
  73. borderWidth: 1,
  74. padding: spaces.spacingMd,
  75. marginBottom: spaces.spacingMd
  76. }}
  77. >
  78. <Text variant="headlineSmallSize">{localize("installation-installationTitle")}</Text>
  79. <CodeViewer
  80. code={"yarn add ncore-ui-kit"}
  81. language="bash"
  82. />
  83. </View>
  84. <View
  85. style={{
  86. backgroundColor: colors.content.container.default,
  87. borderColor: colors.content.border.subtle,
  88. borderRadius: 10,
  89. borderWidth: 1,
  90. padding: spaces.spacingMd,
  91. marginBottom: spaces.spacingMd
  92. }}
  93. >
  94. <Text variant="headlineSmallSize">{localize("installation-peerDepsTitle")}</Text>
  95. <Text
  96. variant="bodyMediumSize"
  97. color="mid"
  98. style={{
  99. marginBottom: 10,
  100. marginTop: 10
  101. }}
  102. >
  103. {localize("installation-peerDepsDesc")}
  104. </Text>
  105. <CodeViewer
  106. code="yarn add @react-native-clipboard/clipboard lucide-react-native moment ncore-context react-native-safe-area-context react-native-svg rrule"
  107. language="bash"
  108. />
  109. </View>
  110. <View
  111. style={{
  112. flexDirection: "row",
  113. justifyContent: "flex-end",
  114. marginTop: spaces.spacingMd
  115. }}
  116. >
  117. <Button
  118. icon={({
  119. color,
  120. size
  121. }) => {
  122. return <ChevronRightIcon
  123. color={colors.content.icon[color]}
  124. size={size + 3}
  125. />;
  126. }}
  127. title={localize("next")}
  128. iconDirection="right"
  129. onPress={() => {
  130. navigation.navigate("GettingStarted", {
  131. screen: "Implementation"
  132. });
  133. }}
  134. />
  135. </View>
  136. </View>
  137. </PageContainer>
  138. );
  139. };
  140. export default Installation;