index.tsx 31 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890
  1. import {
  2. useEffect
  3. } from "react";
  4. import {
  5. Platform,
  6. View
  7. } from "react-native";
  8. import type RootStackParamList from "./type";
  9. import stylesheet from "./stylesheet";
  10. import {
  11. NCoreUIKitEmbeddedMenu,
  12. NCoreUIKitLocalize,
  13. NCoreUIKitTheme,
  14. PaletteSwitcher,
  15. LocaleSwitcher,
  16. ThemeSwitcher,
  17. MainHeader
  18. } from "ncore-ui-kit";
  19. import {
  20. type LinkingOptions,
  21. NavigationContainer,
  22. getStateFromPath,
  23. useNavigation
  24. } from "@react-navigation/native";
  25. import TypesOverridePage from "../pages/coreFeatures/typesOverride";
  26. import {
  27. type NativeStackNavigationProp,
  28. createNativeStackNavigator
  29. } from "@react-navigation/native-stack";
  30. import {
  31. ComponentIcon,
  32. SettingsIcon,
  33. GoalIcon,
  34. HomeIcon
  35. } from "lucide-react-native";
  36. import NotificationIndicatorPage from "../pages/components/notificationIndicator";
  37. import HighlightButtonPage from "../pages/components/highlightButton";
  38. import PaletteSwitcherPage from "../pages/components/paletteSwitcher";
  39. import LocaleExamplesPage from "../pages/coreFeatures/localeExamples";
  40. import DateTimePickerPage from "../pages/components/dateTimePicker";
  41. import LocaleSwitcherPage from "../pages/components/localeSwitcher";
  42. import MarkdownViewerPage from "../pages/components/markdownViewer";
  43. import ThemeExamplesPage from "../pages/coreFeatures/themeExamples";
  44. import DateTimeSheetPage from "../pages/components/dateTimeSheet";
  45. import MonthSelectorPage from "../pages/components/monthSelector";
  46. import PageContainerPage from "../pages/components/pageContainer";
  47. import TextAreaInputPage from "../pages/components/textAreaInput";
  48. import ThemeSwitcherPage from "../pages/components/themeSwitcher";
  49. import DateSelectorPage from "../pages/components/dateSelector";
  50. import EmbeddedMenuPage from "../pages/components/embeddedMenu";
  51. import NumericInputPage from "../pages/components/numericInput";
  52. import TimeSelectorPage from "../pages/components/timeSelector";
  53. import WebScrollbarPage from "../pages/components/webScrollbar";
  54. import YearSelectorPage from "../pages/components/yearSelector";
  55. import AvatarGroupPage from "../pages/components/avatarGroup";
  56. import BottomSheetPage from "../pages/components/bottomSheet";
  57. import RadioButtonPage from "../pages/components/radioButton";
  58. import SelectSheetPage from "../pages/components/selectSheet";
  59. import ToolsUsagePage from "../pages/coreFeatures/toolsUsage";
  60. import CodeViewerPage from "../pages/components/codeViewer";
  61. import MainHeaderPage from "../pages/components/mainHeader";
  62. import SelectBoxPage from "../pages/components/selectBox";
  63. import SeperatorPage from "../pages/components/seperator";
  64. import StateCardPage from "../pages/components/stateCard";
  65. import TextInputPage from "../pages/components/textInput";
  66. import ImplementationPage from "../pages/implementation";
  67. import CheckBoxPage from "../pages/components/checkBox";
  68. import SiteLogoPage from "../pages/components/siteLogo";
  69. import SnackBarPage from "../pages/components/snackBar";
  70. import LoadingPage from "../pages/components/loading";
  71. import RowCardPage from "../pages/components/rowCard";
  72. import StickerPage from "../pages/components/sticker";
  73. import InstallationPage from "../pages/installation";
  74. import AvatarPage from "../pages/components/avatar";
  75. import ButtonPage from "../pages/components/button";
  76. import DialogPage from "../pages/components/dialog";
  77. import HeaderPage from "../pages/components/header";
  78. import SwitchPage from "../pages/components/switch";
  79. import ModalPage from "../pages/components/modal";
  80. import ToastPage from "../pages/components/toast";
  81. import ChipPage from "../pages/components/chip";
  82. import MenuPage from "../pages/components/menu";
  83. import TextPage from "../pages/components/text";
  84. import Home from "../pages/home";
  85. const RootStack = createNativeStackNavigator();
  86. const ComponentsStack = createNativeStackNavigator();
  87. const GettingStartedStack = createNativeStackNavigator();
  88. const CoreFeaturesStack = createNativeStackNavigator();
  89. const CoreFeaturesNav = () => {
  90. return <CoreFeaturesStack.Navigator
  91. initialRouteName="ToolsUsage"
  92. screenOptions={{
  93. headerShown: true
  94. }}
  95. >
  96. <CoreFeaturesStack.Screen
  97. component={ToolsUsagePage}
  98. name="ToolsUsage"
  99. />
  100. <CoreFeaturesStack.Screen
  101. component={ThemeExamplesPage}
  102. name="ThemeExamples"
  103. />
  104. <CoreFeaturesStack.Screen
  105. component={LocaleExamplesPage}
  106. name="LocaleExamples"
  107. />
  108. <CoreFeaturesStack.Screen
  109. component={TypesOverridePage}
  110. name="TypesOverride"
  111. />
  112. </CoreFeaturesStack.Navigator>;
  113. };
  114. const GettingStartedNav = () => {
  115. return <GettingStartedStack.Navigator
  116. initialRouteName="Installation"
  117. screenOptions={{
  118. headerShown: true
  119. }}
  120. >
  121. <GettingStartedStack.Screen
  122. component={InstallationPage}
  123. name="Installation"
  124. />
  125. <GettingStartedStack.Screen
  126. component={ImplementationPage}
  127. name="Implementation"
  128. />
  129. </GettingStartedStack.Navigator>;
  130. };
  131. const ComponentsNav = () => {
  132. return <ComponentsStack.Navigator
  133. initialRouteName="Text"
  134. screenOptions={{
  135. headerShown: true
  136. }}
  137. >
  138. <ComponentsStack.Screen
  139. component={AvatarPage}
  140. name="Avatar"
  141. />
  142. <ComponentsStack.Screen
  143. component={AvatarGroupPage}
  144. name="AvatarGroup"
  145. />
  146. <ComponentsStack.Screen
  147. component={BottomSheetPage}
  148. name="BottomSheet"
  149. />
  150. <ComponentsStack.Screen
  151. component={ButtonPage}
  152. name="Button"
  153. />
  154. <ComponentsStack.Screen
  155. component={CheckBoxPage}
  156. name="CheckBox"
  157. />
  158. <ComponentsStack.Screen
  159. component={CodeViewerPage}
  160. name="CodeViewer"
  161. />
  162. <ComponentsStack.Screen
  163. component={ChipPage}
  164. name="Chip"
  165. />
  166. <ComponentsStack.Screen
  167. component={DateSelectorPage}
  168. name="DateSelector"
  169. />
  170. <ComponentsStack.Screen
  171. component={DateTimePickerPage}
  172. name="DateTimePicker"
  173. />
  174. <ComponentsStack.Screen
  175. component={DateTimeSheetPage}
  176. name="DateTimeSheet"
  177. />
  178. <ComponentsStack.Screen
  179. component={DialogPage}
  180. name="Dialog"
  181. />
  182. <ComponentsStack.Screen
  183. component={EmbeddedMenuPage}
  184. name="EmbeddedMenu"
  185. />
  186. <ComponentsStack.Screen
  187. component={HeaderPage}
  188. name="Header"
  189. />
  190. <ComponentsStack.Screen
  191. component={HighlightButtonPage}
  192. name="HighlightButton"
  193. />
  194. <ComponentsStack.Screen
  195. component={LoadingPage}
  196. name="Loading"
  197. />
  198. <ComponentsStack.Screen
  199. component={LocaleSwitcherPage}
  200. name="LocaleSwitcher"
  201. />
  202. <ComponentsStack.Screen
  203. component={MainHeaderPage}
  204. name="MainHeader"
  205. />
  206. <ComponentsStack.Screen
  207. component={MarkdownViewerPage}
  208. name="MarkdownViewer"
  209. />
  210. <ComponentsStack.Screen
  211. component={MenuPage}
  212. name="Menu"
  213. />
  214. <ComponentsStack.Screen
  215. component={ModalPage}
  216. name="Modal"
  217. />
  218. <ComponentsStack.Screen
  219. component={MonthSelectorPage}
  220. name="MonthSelector"
  221. />
  222. <ComponentsStack.Screen
  223. component={NotificationIndicatorPage}
  224. name="NotificationIndicator"
  225. />
  226. <ComponentsStack.Screen
  227. component={NumericInputPage}
  228. name="NumericInput"
  229. />
  230. <ComponentsStack.Screen
  231. component={PageContainerPage}
  232. name="PageContainer"
  233. />
  234. <ComponentsStack.Screen
  235. component={PaletteSwitcherPage}
  236. name="PaletteSwitcher"
  237. />
  238. <ComponentsStack.Screen
  239. component={RadioButtonPage}
  240. name="RadioButton"
  241. />
  242. <ComponentsStack.Screen
  243. component={RowCardPage}
  244. name="RowCard"
  245. />
  246. <ComponentsStack.Screen
  247. component={SelectBoxPage}
  248. name="SelectBox"
  249. />
  250. <ComponentsStack.Screen
  251. component={SelectSheetPage}
  252. name="SelectSheet"
  253. />
  254. <ComponentsStack.Screen
  255. component={SeperatorPage}
  256. name="Seperator"
  257. />
  258. <ComponentsStack.Screen
  259. component={SiteLogoPage}
  260. name="SiteLogo"
  261. />
  262. <ComponentsStack.Screen
  263. component={SnackBarPage}
  264. name="SnackBar"
  265. />
  266. <ComponentsStack.Screen
  267. component={StateCardPage}
  268. name="StateCard"
  269. />
  270. <ComponentsStack.Screen
  271. component={StickerPage}
  272. name="Sticker"
  273. />
  274. <ComponentsStack.Screen
  275. component={SwitchPage}
  276. name="Switch"
  277. />
  278. <ComponentsStack.Screen
  279. component={TextPage}
  280. name="Text"
  281. />
  282. <ComponentsStack.Screen
  283. component={TextAreaInputPage}
  284. name="TextAreaInput"
  285. />
  286. <ComponentsStack.Screen
  287. component={TextInputPage}
  288. name="TextInput"
  289. />
  290. <ComponentsStack.Screen
  291. component={ThemeSwitcherPage}
  292. name="ThemeSwitcher"
  293. />
  294. <ComponentsStack.Screen
  295. component={TimeSelectorPage}
  296. name="TimeSelector"
  297. />
  298. <ComponentsStack.Screen
  299. component={ToastPage}
  300. name="Toast"
  301. />
  302. <ComponentsStack.Screen
  303. component={WebScrollbarPage}
  304. name="WebScrollbar"
  305. />
  306. <ComponentsStack.Screen
  307. component={YearSelectorPage}
  308. name="YearSelector"
  309. />
  310. </ComponentsStack.Navigator>;
  311. };
  312. const RenderHomeIcon = ({
  313. color
  314. }: {
  315. color: keyof NCoreUIKit.IconContentColors;
  316. }) => {
  317. const {
  318. colors
  319. } = NCoreUIKitTheme.useContext();
  320. return <HomeIcon
  321. color={colors.content.icon[color]}
  322. />;
  323. };
  324. const RenderComponentIcon = ({
  325. color
  326. }: {
  327. color: keyof NCoreUIKit.IconContentColors;
  328. }) => {
  329. const {
  330. colors
  331. } = NCoreUIKitTheme.useContext();
  332. return <ComponentIcon
  333. color={colors.content.icon[color]}
  334. />;
  335. };
  336. const RenderGettingStartedIcon = ({
  337. color
  338. }: {
  339. color: keyof NCoreUIKit.IconContentColors;
  340. }) => {
  341. const {
  342. colors
  343. } = NCoreUIKitTheme.useContext();
  344. return <GoalIcon
  345. color={colors.content.icon[color]}
  346. />;
  347. };
  348. const RenderCoreFeaturesIcon = ({
  349. color
  350. }: {
  351. color: keyof NCoreUIKit.IconContentColors;
  352. }) => {
  353. const {
  354. colors
  355. } = NCoreUIKitTheme.useContext();
  356. return <SettingsIcon
  357. color={colors.content.icon[color]}
  358. />;
  359. };
  360. const RootNav = () => {
  361. const {
  362. activeTheme,
  363. spaces
  364. } = NCoreUIKitTheme.useContext();
  365. const {
  366. localize
  367. } = NCoreUIKitLocalize.useContext();
  368. const navigation = useNavigation<NativeStackNavigationProp<RootStackParamList>>();
  369. useEffect(() => {
  370. const currentMenuStatus = Platform.OS === "web" ? window.localStorage.getItem("main-menu-status") : "false";
  371. NCoreUIKitEmbeddedMenu.load({
  372. isCollapse: currentMenuStatus === "true" ? true : false,
  373. isWorkWithSafeAreaView: false,
  374. siteLogoProps: {
  375. isShowIcon: false,
  376. title: localize("menu")
  377. },
  378. buttons: [
  379. {
  380. redirectMain: "Home",
  381. isUseLocalize: true,
  382. title: "home",
  383. icon: ({
  384. color
  385. }) => <RenderHomeIcon
  386. color={color}
  387. />
  388. },
  389. {
  390. redirectMain: "GettingStarted",
  391. isCollapsible: true,
  392. title: "gettingStarted",
  393. isUseLocalize: true,
  394. icon: ({
  395. color
  396. }) => <RenderGettingStartedIcon
  397. color={color}
  398. />,
  399. subButtons: [
  400. {
  401. redirectMain: "GettingStarted",
  402. redirectSub: "Installation",
  403. title: "installation",
  404. isUseLocalize: true
  405. },
  406. {
  407. redirectMain: "GettingStarted",
  408. redirectSub: "Implementation",
  409. title: "implementation",
  410. isUseLocalize: true
  411. }
  412. ]
  413. },
  414. {
  415. redirectMain: "CoreFeatures",
  416. isCollapsible: true,
  417. title: "coreFeatures",
  418. isUseLocalize: true,
  419. icon: ({
  420. color
  421. }) => <RenderCoreFeaturesIcon
  422. color={color}
  423. />,
  424. subButtons: [
  425. {
  426. redirectMain: "CoreFeatures",
  427. redirectSub: "ToolsUsage",
  428. title: "toolsUsage",
  429. isUseLocalize: true
  430. },
  431. {
  432. redirectMain: "CoreFeatures",
  433. redirectSub: "ThemeExamples",
  434. title: "themeExamples",
  435. isUseLocalize: true
  436. },
  437. {
  438. redirectMain: "CoreFeatures",
  439. redirectSub: "LocaleExamples",
  440. title: "localeExamples",
  441. isUseLocalize: true
  442. },
  443. {
  444. redirectMain: "CoreFeatures",
  445. redirectSub: "TypesOverride",
  446. title: "typesOverride",
  447. isUseLocalize: true
  448. }
  449. ]
  450. },
  451. {
  452. redirectMain: "Components",
  453. isUseLocalize: true,
  454. isCollapsible: true,
  455. title: "components",
  456. icon: ({
  457. color
  458. }) => <RenderComponentIcon
  459. color={color}
  460. />,
  461. subButtons: [
  462. {
  463. redirectMain: "Components",
  464. redirectSub: "Text",
  465. title: "Text"
  466. },
  467. {
  468. redirectMain: "Components",
  469. redirectSub: "Button",
  470. title: "Button"
  471. },
  472. {
  473. redirectMain: "Components",
  474. redirectSub: "HighlightButton",
  475. title: "HighlightButton"
  476. },
  477. {
  478. redirectMain: "Components",
  479. redirectSub: "TextInput",
  480. title: "TextInput"
  481. },
  482. {
  483. redirectMain: "Components",
  484. redirectSub: "TextAreaInput",
  485. title: "TextAreaInput"
  486. },
  487. {
  488. redirectMain: "Components",
  489. redirectSub: "NumericInput",
  490. title: "NumericInput"
  491. },
  492. {
  493. redirectMain: "Components",
  494. redirectSub: "SelectBox",
  495. title: "SelectBox"
  496. },
  497. {
  498. redirectMain: "Components",
  499. redirectSub: "SelectSheet",
  500. title: "SelectSheet"
  501. },
  502. {
  503. redirectMain: "Components",
  504. redirectSub: "CheckBox",
  505. title: "CheckBox"
  506. },
  507. {
  508. redirectMain: "Components",
  509. redirectSub: "RadioButton",
  510. title: "RadioButton"
  511. },
  512. {
  513. redirectMain: "Components",
  514. redirectSub: "Switch",
  515. title: "Switch"
  516. },
  517. {
  518. redirectMain: "Components",
  519. redirectSub: "DateTimePicker",
  520. title: "DateTimePicker"
  521. },
  522. {
  523. redirectMain: "Components",
  524. redirectSub: "DateTimeSheet",
  525. title: "DateTimeSheet"
  526. },
  527. {
  528. redirectMain: "Components",
  529. redirectSub: "DateSelector",
  530. title: "DateSelector"
  531. },
  532. {
  533. redirectMain: "Components",
  534. redirectSub: "TimeSelector",
  535. title: "TimeSelector"
  536. },
  537. {
  538. redirectMain: "Components",
  539. redirectSub: "MonthSelector",
  540. title: "MonthSelector"
  541. },
  542. {
  543. redirectMain: "Components",
  544. redirectSub: "YearSelector",
  545. title: "YearSelector"
  546. },
  547. {
  548. redirectMain: "Components",
  549. redirectSub: "Avatar",
  550. title: "Avatar"
  551. },
  552. {
  553. redirectMain: "Components",
  554. redirectSub: "AvatarGroup",
  555. title: "AvatarGroup"
  556. },
  557. {
  558. redirectMain: "Components",
  559. redirectSub: "CodeViewer",
  560. title: "CodeViewer"
  561. },
  562. {
  563. redirectMain: "Components",
  564. redirectSub: "Chip",
  565. title: "Chip"
  566. },
  567. {
  568. redirectMain: "Components",
  569. redirectSub: "Sticker",
  570. title: "Sticker"
  571. },
  572. {
  573. redirectMain: "Components",
  574. redirectSub: "RowCard",
  575. title: "RowCard"
  576. },
  577. {
  578. redirectMain: "Components",
  579. redirectSub: "StateCard",
  580. title: "StateCard"
  581. },
  582. {
  583. redirectMain: "Components",
  584. redirectSub: "Dialog",
  585. title: "Dialog"
  586. },
  587. {
  588. redirectMain: "Components",
  589. redirectSub: "Modal",
  590. title: "Modal"
  591. },
  592. {
  593. redirectMain: "Components",
  594. redirectSub: "BottomSheet",
  595. title: "BottomSheet"
  596. },
  597. {
  598. redirectMain: "Components",
  599. redirectSub: "SnackBar",
  600. title: "SnackBar"
  601. },
  602. {
  603. redirectMain: "Components",
  604. redirectSub: "Toast",
  605. title: "Toast"
  606. },
  607. {
  608. redirectMain: "Components",
  609. redirectSub: "Loading",
  610. title: "Loading"
  611. },
  612. {
  613. redirectMain: "Components",
  614. redirectSub: "NotificationIndicator",
  615. title: "NotificationIndicator"
  616. },
  617. {
  618. redirectMain: "Components",
  619. redirectSub: "MarkdownViewer",
  620. title: "MarkdownViewer"
  621. },
  622. {
  623. redirectMain: "Components",
  624. redirectSub: "Seperator",
  625. title: "Seperator"
  626. },
  627. {
  628. redirectMain: "Components",
  629. redirectSub: "SiteLogo",
  630. title: "SiteLogo"
  631. },
  632. {
  633. redirectMain: "Components",
  634. redirectSub: "WebScrollbar",
  635. title: "WebScrollbar"
  636. },
  637. {
  638. redirectMain: "Components",
  639. redirectSub: "PageContainer",
  640. title: "PageContainer"
  641. },
  642. {
  643. redirectMain: "Components",
  644. redirectSub: "Header",
  645. title: "Header"
  646. },
  647. {
  648. redirectMain: "Components",
  649. redirectSub: "MainHeader",
  650. title: "MainHeader"
  651. },
  652. {
  653. redirectMain: "Components",
  654. redirectSub: "Menu",
  655. title: "Menu"
  656. },
  657. {
  658. redirectMain: "Components",
  659. redirectSub: "EmbeddedMenu",
  660. title: "EmbeddedMenu"
  661. },
  662. {
  663. redirectMain: "Components",
  664. redirectSub: "ThemeSwitcher",
  665. title: "ThemeSwitcher"
  666. },
  667. {
  668. redirectMain: "Components",
  669. redirectSub: "PaletteSwitcher",
  670. title: "PaletteSwitcher"
  671. },
  672. {
  673. redirectMain: "Components",
  674. redirectSub: "LocaleSwitcher",
  675. title: "LocaleSwitcher"
  676. }
  677. ]
  678. }
  679. ],
  680. isAutoClosed: true,
  681. id: "main-menu"
  682. });
  683. NCoreUIKitLocalize.addEventListener("state", updateLocaleStorage);
  684. NCoreUIKitEmbeddedMenu.addEventListener("state", updateStorage);
  685. NCoreUIKitTheme.addEventListener("state", updateThemeStorage);
  686. }, []);
  687. const updateStorage = () => {
  688. if(Platform.OS === "web") {
  689. const data = NCoreUIKitEmbeddedMenu.state.data;
  690. if(data && data.length) {
  691. const currentMenu = data.find(dI => dI.id === "main-menu");
  692. if(currentMenu) {
  693. window.localStorage.setItem("main-menu-status", String(currentMenu.isCollapse));
  694. }
  695. }
  696. }
  697. };
  698. const updateLocaleStorage = () => {
  699. if(Platform.OS === "web") {
  700. const localeData = NCoreUIKitLocalize.state;
  701. if(localeData) {
  702. window.localStorage.setItem("locale", JSON.stringify(localeData));
  703. }
  704. }
  705. };
  706. const updateThemeStorage = () => {
  707. if(Platform.OS === "web") {
  708. const themeData = NCoreUIKitTheme.state;
  709. if(themeData) {
  710. window.localStorage.setItem("theme", JSON.stringify(themeData));
  711. }
  712. }
  713. };
  714. return <MainHeader
  715. isWorkWithSeperator={true}
  716. siteLogoProps={{
  717. imageUrl: activeTheme.indexOf("dark") !== -1 ? "http://ncore.nibgat.space/assets/images/darklogo.png" : "http://ncore.nibgat.space/assets/images/ncorelogo.png",
  718. onPress: () => {
  719. navigation.navigate("Home");
  720. },
  721. imageProps: {
  722. resizeMode: "stretch"
  723. },
  724. subTitle: "Design System - UI Kit",
  725. title: "NİBGAT® | NCore",
  726. isWorkWithAction: true,
  727. isWorkWithFlex1: true
  728. }}
  729. isWorkWithSticky={true}
  730. renderRight={() => {
  731. return <View
  732. style={[
  733. stylesheet.rightContainer,
  734. {
  735. gap: spaces.spacingMd
  736. }
  737. ]}
  738. >
  739. <LocaleSwitcher/>
  740. <PaletteSwitcher/>
  741. <ThemeSwitcher/>
  742. </View>;
  743. }}
  744. glassEffect={5}
  745. >
  746. <NCoreUIKitEmbeddedMenu.Render
  747. navigation={navigation as unknown as NCoreUIKit.Navigation}
  748. id="main-menu"
  749. >
  750. <RootStack.Navigator
  751. initialRouteName="Home"
  752. screenOptions={{
  753. headerShown: false
  754. }}
  755. >
  756. <RootStack.Screen
  757. component={GettingStartedNav}
  758. name="GettingStarted"
  759. />
  760. <RootStack.Screen
  761. component={CoreFeaturesNav}
  762. name="CoreFeatures"
  763. />
  764. <RootStack.Screen
  765. component={Home}
  766. name="Home"
  767. />
  768. <RootStack.Screen
  769. component={ComponentsNav}
  770. name="Components"
  771. />
  772. </RootStack.Navigator>
  773. </NCoreUIKitEmbeddedMenu.Render>
  774. </MainHeader>;
  775. };
  776. const Navigation = () => {
  777. return <NavigationContainer
  778. documentTitle={{
  779. formatter: (options, route) => `NCore - Design System | UI Kit - ${options?.title ?? route?.name ?? "Home"}`
  780. }}
  781. linking={{
  782. prefixes: [
  783. "http://localhost:3000",
  784. "https://ncore.nibgat.space"
  785. ],
  786. config: {
  787. screens: {
  788. Home: "home",
  789. GettingStarted: {
  790. path: "gettingstarted",
  791. screens: {
  792. Installation: "installation",
  793. Implementation: "implementation"
  794. }
  795. },
  796. CoreFeatures: {
  797. path: "corefeatures",
  798. screens: {
  799. ToolsUsage: "toolsusage",
  800. ThemeExamples: "themeexamples",
  801. LocaleExamples: "localeexamples",
  802. TypesOverride: "typesoverride"
  803. }
  804. },
  805. Components: {
  806. path: "components",
  807. screens: {
  808. Avatar: "avatar",
  809. AvatarGroup: "avatargroup",
  810. BottomSheet: "bottomsheet",
  811. Button: "button",
  812. CheckBox: "checkbox",
  813. Chip: "chip",
  814. CodeViewer: "codeviewer",
  815. DateSelector: "dateselector",
  816. DateTimePicker: "datetimepicker",
  817. DateTimeSheet: "datetimesheet",
  818. Dialog: "dialog",
  819. EmbeddedMenu: "embeddedmenu",
  820. Header: "header",
  821. HighlightButton: "highlightbutton",
  822. Loading: "loading",
  823. LocaleSwitcher: "localeswitcher",
  824. MainHeader: "mainheader",
  825. MarkdownViewer: "markdownviewer",
  826. Menu: "menu",
  827. Modal: "modal",
  828. MonthSelector: "monthselector",
  829. NotificationIndicator: "notificationindicator",
  830. NumericInput: "numericinput",
  831. PageContainer: "pagecontainer",
  832. PaletteSwitcher: "paletteswitcher",
  833. RadioButton: "radiobutton",
  834. RowCard: "rowcard",
  835. SelectBox: "selectbox",
  836. SelectSheet: "selectsheet",
  837. Seperator: "seperator",
  838. SiteLogo: "sitelogo",
  839. SnackBar: "snackbar",
  840. StateCard: "statecard",
  841. Sticker: "sticker",
  842. Switch: "switch",
  843. Text: "text",
  844. TextAreaInput: "textareainput",
  845. TextInput: "textinput",
  846. ThemeSwitcher: "themeswitcher",
  847. TimeSelector: "timeselector",
  848. Toast: "toast",
  849. WebScrollbar: "webscrollbar",
  850. YearSelector: "yearselector"
  851. }
  852. }
  853. }
  854. },
  855. getStateFromPath: (path, options) => {
  856. return getStateFromPath(path.toLowerCase(), options);
  857. }
  858. } as LinkingOptions<RootStackParamList>}
  859. >
  860. <RootNav/>
  861. </NavigationContainer>;
  862. };
  863. export default Navigation;