ignite-parse-auth-kit 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (241) hide show
  1. package/CONTRIBUTING.md +0 -0
  2. package/LICENSE +21 -0
  3. package/README.md +492 -0
  4. package/app/app.tsx +116 -0
  5. package/app/components/AlertTongle.tsx +105 -0
  6. package/app/components/AutoImage.tsx +89 -0
  7. package/app/components/Button.tsx +248 -0
  8. package/app/components/Card.tsx +314 -0
  9. package/app/components/EmptyState.tsx +248 -0
  10. package/app/components/Header.tsx +332 -0
  11. package/app/components/Icon.tsx +140 -0
  12. package/app/components/ListItem.tsx +243 -0
  13. package/app/components/ListView.tsx +42 -0
  14. package/app/components/Screen.tsx +305 -0
  15. package/app/components/Text.test.tsx +23 -0
  16. package/app/components/Text.tsx +116 -0
  17. package/app/components/TextField.tsx +292 -0
  18. package/app/components/Toggle/Checkbox.tsx +123 -0
  19. package/app/components/Toggle/Radio.tsx +106 -0
  20. package/app/components/Toggle/Switch.tsx +264 -0
  21. package/app/components/Toggle/Toggle.tsx +285 -0
  22. package/app/components/index copy.ts +15 -0
  23. package/app/components/index.ts +18 -0
  24. package/app/config/config.base.ts +26 -0
  25. package/app/config/config.dev.ts +10 -0
  26. package/app/config/config.prod.ts +10 -0
  27. package/app/config/index.ts +28 -0
  28. package/app/context/AuthContext.tsx +14 -0
  29. package/app/context/EpisodeContext.tsx +136 -0
  30. package/app/context/auth/AuthProvider.tsx +340 -0
  31. package/app/context/auth/hooks.ts +29 -0
  32. package/app/context/auth/index.ts +38 -0
  33. package/app/context/auth/reducer.ts +68 -0
  34. package/app/context/auth/services.ts +394 -0
  35. package/app/context/auth/types.ts +99 -0
  36. package/app/context/auth/validation.ts +45 -0
  37. package/app/devtools/ReactotronClient.ts +9 -0
  38. package/app/devtools/ReactotronClient.web.ts +12 -0
  39. package/app/devtools/ReactotronConfig.ts +139 -0
  40. package/app/i18n/ar.ts +126 -0
  41. package/app/i18n/demo-ar.ts +464 -0
  42. package/app/i18n/demo-en.ts +462 -0
  43. package/app/i18n/demo-es.ts +469 -0
  44. package/app/i18n/demo-fr.ts +471 -0
  45. package/app/i18n/demo-hi.ts +468 -0
  46. package/app/i18n/demo-ja.ts +464 -0
  47. package/app/i18n/demo-ko.ts +457 -0
  48. package/app/i18n/en.ts +146 -0
  49. package/app/i18n/es.ts +132 -0
  50. package/app/i18n/fr.ts +132 -0
  51. package/app/i18n/hi.ts +131 -0
  52. package/app/i18n/index.ts +86 -0
  53. package/app/i18n/ja.ts +130 -0
  54. package/app/i18n/ko.ts +129 -0
  55. package/app/i18n/translate.ts +33 -0
  56. package/app/lib/Parse/index.ts +2 -0
  57. package/app/lib/Parse/parse.ts +62 -0
  58. package/app/navigators/AppNavigator.tsx +145 -0
  59. package/app/navigators/DemoNavigator.tsx +137 -0
  60. package/app/navigators/navigationUtilities.ts +208 -0
  61. package/app/screens/ChooseAuthScreen.tsx +224 -0
  62. package/app/screens/DemoCommunityScreen.tsx +141 -0
  63. package/app/screens/DemoDebugScreen.tsx +192 -0
  64. package/app/screens/DemoPodcastListScreen.tsx +387 -0
  65. package/app/screens/DemoShowroomScreen/DemoDivider.tsx +66 -0
  66. package/app/screens/DemoShowroomScreen/DemoShowroomScreen.tsx +313 -0
  67. package/app/screens/DemoShowroomScreen/DemoUseCase.tsx +52 -0
  68. package/app/screens/DemoShowroomScreen/DrawerIconButton.tsx +120 -0
  69. package/app/screens/DemoShowroomScreen/SectionListWithKeyboardAwareScrollView.tsx +59 -0
  70. package/app/screens/DemoShowroomScreen/demos/DemoAutoImage.tsx +230 -0
  71. package/app/screens/DemoShowroomScreen/demos/DemoButton.tsx +234 -0
  72. package/app/screens/DemoShowroomScreen/demos/DemoCard.tsx +181 -0
  73. package/app/screens/DemoShowroomScreen/demos/DemoEmptyState.tsx +78 -0
  74. package/app/screens/DemoShowroomScreen/demos/DemoHeader.tsx +151 -0
  75. package/app/screens/DemoShowroomScreen/demos/DemoIcon.tsx +115 -0
  76. package/app/screens/DemoShowroomScreen/demos/DemoListItem.tsx +218 -0
  77. package/app/screens/DemoShowroomScreen/demos/DemoText.tsx +144 -0
  78. package/app/screens/DemoShowroomScreen/demos/DemoTextField.tsx +233 -0
  79. package/app/screens/DemoShowroomScreen/demos/DemoToggle.tsx +354 -0
  80. package/app/screens/DemoShowroomScreen/demos/index.ts +12 -0
  81. package/app/screens/ErrorScreen/ErrorBoundary.tsx +76 -0
  82. package/app/screens/ErrorScreen/ErrorDetails.tsx +98 -0
  83. package/app/screens/ForgetPasswordScreen.tsx +180 -0
  84. package/app/screens/LoginScreen.tsx +260 -0
  85. package/app/screens/RegisterScreen.tsx +395 -0
  86. package/app/screens/WelcomeScreen.tsx +114 -0
  87. package/app/services/api/apiProblem.test.ts +73 -0
  88. package/app/services/api/apiProblem.ts +74 -0
  89. package/app/services/api/index.ts +91 -0
  90. package/app/services/api/types.ts +50 -0
  91. package/app/theme/colors.ts +85 -0
  92. package/app/theme/colorsDark.ts +50 -0
  93. package/app/theme/context.tsx +145 -0
  94. package/app/theme/context.utils.ts +25 -0
  95. package/app/theme/spacing.ts +14 -0
  96. package/app/theme/spacingDark.ts +14 -0
  97. package/app/theme/styles.ts +24 -0
  98. package/app/theme/theme.ts +23 -0
  99. package/app/theme/timing.ts +6 -0
  100. package/app/theme/types.ts +64 -0
  101. package/app/theme/typography.ts +71 -0
  102. package/app/utils/crashReporting.ts +62 -0
  103. package/app/utils/delay.ts +6 -0
  104. package/app/utils/formatDate.ts +49 -0
  105. package/app/utils/gestureHandler.native.ts +3 -0
  106. package/app/utils/gestureHandler.ts +6 -0
  107. package/app/utils/hasValidStringProp.ts +11 -0
  108. package/app/utils/openLinkInBrowser.ts +8 -0
  109. package/app/utils/storage/index.ts +82 -0
  110. package/app/utils/storage/storage.test.ts +61 -0
  111. package/app/utils/useHeader.tsx +37 -0
  112. package/app/utils/useIsMounted.ts +18 -0
  113. package/app/utils/useSafeAreaInsetsStyle.ts +46 -0
  114. package/app.config.ts +39 -0
  115. package/app.json +67 -0
  116. package/assets/icons/back.png +0 -0
  117. package/assets/icons/back@2x.png +0 -0
  118. package/assets/icons/back@3x.png +0 -0
  119. package/assets/icons/bell.png +0 -0
  120. package/assets/icons/bell@2x.png +0 -0
  121. package/assets/icons/bell@3x.png +0 -0
  122. package/assets/icons/caretLeft.png +0 -0
  123. package/assets/icons/caretLeft@2x.png +0 -0
  124. package/assets/icons/caretLeft@3x.png +0 -0
  125. package/assets/icons/caretRight.png +0 -0
  126. package/assets/icons/caretRight@2x.png +0 -0
  127. package/assets/icons/caretRight@3x.png +0 -0
  128. package/assets/icons/check.png +0 -0
  129. package/assets/icons/check@2x.png +0 -0
  130. package/assets/icons/check@3x.png +0 -0
  131. package/assets/icons/demo/clap.png +0 -0
  132. package/assets/icons/demo/clap@2x.png +0 -0
  133. package/assets/icons/demo/clap@3x.png +0 -0
  134. package/assets/icons/demo/community.png +0 -0
  135. package/assets/icons/demo/community@2x.png +0 -0
  136. package/assets/icons/demo/community@3x.png +0 -0
  137. package/assets/icons/demo/components.png +0 -0
  138. package/assets/icons/demo/components@2x.png +0 -0
  139. package/assets/icons/demo/components@3x.png +0 -0
  140. package/assets/icons/demo/debug.png +0 -0
  141. package/assets/icons/demo/debug@2x.png +0 -0
  142. package/assets/icons/demo/debug@3x.png +0 -0
  143. package/assets/icons/demo/github.png +0 -0
  144. package/assets/icons/demo/github@2x.png +0 -0
  145. package/assets/icons/demo/github@3x.png +0 -0
  146. package/assets/icons/demo/heart.png +0 -0
  147. package/assets/icons/demo/heart@2x.png +0 -0
  148. package/assets/icons/demo/heart@3x.png +0 -0
  149. package/assets/icons/demo/pin.png +0 -0
  150. package/assets/icons/demo/pin@2x.png +0 -0
  151. package/assets/icons/demo/pin@3x.png +0 -0
  152. package/assets/icons/demo/podcast.png +0 -0
  153. package/assets/icons/demo/podcast@2x.png +0 -0
  154. package/assets/icons/demo/podcast@3x.png +0 -0
  155. package/assets/icons/demo/slack.png +0 -0
  156. package/assets/icons/demo/slack@2x.png +0 -0
  157. package/assets/icons/demo/slack@3x.png +0 -0
  158. package/assets/icons/google.png +0 -0
  159. package/assets/icons/hidden.png +0 -0
  160. package/assets/icons/hidden@2x.png +0 -0
  161. package/assets/icons/hidden@3x.png +0 -0
  162. package/assets/icons/ladybug.png +0 -0
  163. package/assets/icons/ladybug@2x.png +0 -0
  164. package/assets/icons/ladybug@3x.png +0 -0
  165. package/assets/icons/lock.png +0 -0
  166. package/assets/icons/lock@2x.png +0 -0
  167. package/assets/icons/lock@3x.png +0 -0
  168. package/assets/icons/menu.png +0 -0
  169. package/assets/icons/menu@2x.png +0 -0
  170. package/assets/icons/menu@3x.png +0 -0
  171. package/assets/icons/more.png +0 -0
  172. package/assets/icons/more@2x.png +0 -0
  173. package/assets/icons/more@3x.png +0 -0
  174. package/assets/icons/settings.png +0 -0
  175. package/assets/icons/settings@2x.png +0 -0
  176. package/assets/icons/settings@3x.png +0 -0
  177. package/assets/icons/view.png +0 -0
  178. package/assets/icons/view@2x.png +0 -0
  179. package/assets/icons/view@3x.png +0 -0
  180. package/assets/icons/x.png +0 -0
  181. package/assets/icons/x@2x.png +0 -0
  182. package/assets/icons/x@3x.png +0 -0
  183. package/assets/images/app-icon-all.png +0 -0
  184. package/assets/images/app-icon-android-adaptive-background.png +0 -0
  185. package/assets/images/app-icon-android-adaptive-foreground.png +0 -0
  186. package/assets/images/app-icon-android-legacy.png +0 -0
  187. package/assets/images/app-icon-ios.png +0 -0
  188. package/assets/images/app-icon-web-favicon.png +0 -0
  189. package/assets/images/demo/cr-logo.png +0 -0
  190. package/assets/images/demo/cr-logo@2x.png +0 -0
  191. package/assets/images/demo/cr-logo@3x.png +0 -0
  192. package/assets/images/demo/rnl-logo.png +0 -0
  193. package/assets/images/demo/rnl-logo@2x.png +0 -0
  194. package/assets/images/demo/rnl-logo@3x.png +0 -0
  195. package/assets/images/demo/rnn-logo.png +0 -0
  196. package/assets/images/demo/rnn-logo@2x.png +0 -0
  197. package/assets/images/demo/rnn-logo@3x.png +0 -0
  198. package/assets/images/demo/rnr-image-1.png +0 -0
  199. package/assets/images/demo/rnr-image-1@2x.png +0 -0
  200. package/assets/images/demo/rnr-image-1@3x.png +0 -0
  201. package/assets/images/demo/rnr-image-2.png +0 -0
  202. package/assets/images/demo/rnr-image-2@2x.png +0 -0
  203. package/assets/images/demo/rnr-image-2@3x.png +0 -0
  204. package/assets/images/demo/rnr-image-3.png +0 -0
  205. package/assets/images/demo/rnr-image-3@2x.png +0 -0
  206. package/assets/images/demo/rnr-image-3@3x.png +0 -0
  207. package/assets/images/demo/rnr-logo.png +0 -0
  208. package/assets/images/demo/rnr-logo@2x.png +0 -0
  209. package/assets/images/demo/rnr-logo@3x.png +0 -0
  210. package/assets/images/logo.png +0 -0
  211. package/assets/images/logo@2x.png +0 -0
  212. package/assets/images/logo@3x.png +0 -0
  213. package/assets/images/sad-face.png +0 -0
  214. package/assets/images/sad-face@2x.png +0 -0
  215. package/assets/images/sad-face@3x.png +0 -0
  216. package/assets/images/welcome-face.png +0 -0
  217. package/assets/images/welcome-face@2x.png +0 -0
  218. package/assets/images/welcome-face@3x.png +0 -0
  219. package/babel.config.js +7 -0
  220. package/bin/cli.js +196 -0
  221. package/ignite/templates/app-icon/android-adaptive-background.png +0 -0
  222. package/ignite/templates/app-icon/android-adaptive-foreground.png +0 -0
  223. package/ignite/templates/app-icon/android-legacy.png +0 -0
  224. package/ignite/templates/app-icon/ios-universal.png +0 -0
  225. package/ignite/templates/component/NAME.tsx.ejs +39 -0
  226. package/ignite/templates/navigator/NAMENavigator.tsx.ejs +18 -0
  227. package/ignite/templates/screen/NAMEScreen.tsx.ejs +29 -0
  228. package/ignite/templates/splash-screen/logo.png +0 -0
  229. package/index.tsx +9 -0
  230. package/jest.config.js +5 -0
  231. package/metro.config.js +31 -0
  232. package/package.json +166 -0
  233. package/plugins/withSplashScreen.ts +69 -0
  234. package/src/app/_layout.tsx +58 -0
  235. package/src/app/index.tsx +5 -0
  236. package/test/i18n.test.ts +75 -0
  237. package/test/mockFile.ts +6 -0
  238. package/test/setup.ts +58 -0
  239. package/test/test-tsconfig.json +8 -0
  240. package/tsconfig.json +52 -0
  241. package/types/lib.es5.d.ts +25 -0
package/app/i18n/ko.ts ADDED
@@ -0,0 +1,129 @@
1
+ import demoKo from "./demo-ko" // @demo remove-current-line
2
+ import { Translations } from "./en"
3
+
4
+ const ko: Translations = {
5
+ common: {
6
+ ok: "확인!",
7
+ cancel: "취소",
8
+ back: "뒤로",
9
+ logOut: "로그아웃", // @demo remove-current-line
10
+ },
11
+ welcomeScreen: {
12
+ postscript:
13
+ "잠깐! — 지금 보시는 것은 아마도 당신의 앱의 모양새가 아닐겁니다. (디자이너분이 이렇게 건내주셨다면 모를까요. 만약에 그렇다면, 이대로 가져갑시다!) ",
14
+ readyForLaunch: "출시 준비가 거의 끝난 나만의 앱!",
15
+ exciting: "(오, 이거 신나는데요!)",
16
+ letsGo: "가보자구요!", // @demo remove-current-line
17
+ },
18
+ errorScreen: {
19
+ title: "뭔가 잘못되었습니다!",
20
+ friendlySubtitle:
21
+ "이 화면은 오류가 발생할 때 프로덕션에서 사용자에게 표시됩니다. 이 메시지를 커스터마이징 할 수 있고(해당 파일은 `app/i18n/ko.ts` 에 있습니다) 레이아웃도 마찬가지로 수정할 수 있습니다(`app/screens/error`). 만약 이 오류화면을 완전히 없에버리고 싶다면 `app/app.tsx` 파일에서 <ErrorBoundary> 컴포넌트를 확인하기 바랍니다.",
22
+ reset: "초기화",
23
+ traceTitle: "%{name} 스택에서의 오류", // @demo remove-current-line
24
+ },
25
+ emptyStateComponent: {
26
+ generic: {
27
+ heading: "너무 텅 비어서.. 너무 슬퍼요..",
28
+ content: "데이터가 없습니다. 버튼을 눌러서 리프레쉬 하시거나 앱을 리로드하세요.",
29
+ button: "다시 시도해봅시다",
30
+ },
31
+ },
32
+ // @demo remove-block-start
33
+ errors: {
34
+ invalidEmail: "잘못된 이메일 주소 입니다.",
35
+ },
36
+ loginScreen: {
37
+ logIn: "로그인",
38
+ enterDetails:
39
+ "일급비밀 정보를 해제하기 위해 상세 정보를 입력하세요. 무엇이 기다리고 있는지 절대 모를겁니다. 혹은 알 수 있을지도 모르겠군요. 엄청 복잡한 뭔가는 아닙니다.",
40
+ emailFieldLabel: "이메일",
41
+ passwordFieldLabel: "비밀번호",
42
+ emailFieldPlaceholder: "이메일을 입력하세요",
43
+ passwordFieldPlaceholder: "엄청 비밀스러운 암호를 입력하세요",
44
+ tapToLogIn: "눌러서 로그인 하기!",
45
+ hint: "힌트: 가장 좋아하는 암호와 아무런 아무 이메일 주소나 사용할 수 있어요 :)",
46
+ },
47
+ demoNavigator: {
48
+ componentsTab: "컴포넌트",
49
+ debugTab: "디버그",
50
+ communityTab: "커뮤니티",
51
+ podcastListTab: "팟캐스트",
52
+ },
53
+ demoCommunityScreen: {
54
+ title: "커뮤니티와 함께해요",
55
+ tagLine:
56
+ "전문적인 React Native 엔지니어들로 구성된 Infinite Red 커뮤니티에 접속해서 함께 개발 실력을 향상시켜 보세요!",
57
+ joinUsOnSlackTitle: "Slack 에 참여하세요",
58
+ joinUsOnSlack:
59
+ "전 세계 React Native 엔지니어들과 함께할 수 있는 곳이 있었으면 좋겠죠? Infinite Red Community Slack 에서 대화에 참여하세요! 우리의 성장하는 커뮤니티는 질문을 던지고, 다른 사람들로부터 배우고, 네트워크를 확장할 수 있는 안전한 공간입니다. ",
60
+ joinSlackLink: "Slack 에 참여하기",
61
+ makeIgniteEvenBetterTitle: "Ignite 을 향상시켜요",
62
+ makeIgniteEvenBetter:
63
+ "Ignite 을 더 좋게 만들 아이디어가 있나요? 기쁜 소식이네요. 우리는 항상 최고의 React Native 도구를 구축하는데 도움을 줄 수 있는 분들을 찾고 있습니다. GitHub 에서 Ignite 의 미래를 만들어 가는것에 함께해 주세요.",
64
+ contributeToIgniteLink: "Ignite 에 기여하기",
65
+ theLatestInReactNativeTitle: "React Native 의 최신정보",
66
+ theLatestInReactNative: "React Native 가 제공하는 모든 최신 정보를 알려드립니다.",
67
+ reactNativeRadioLink: "React Native 라디오",
68
+ reactNativeNewsletterLink: "React Native 뉴스레터",
69
+ reactNativeLiveLink: "React Native 라이브 스트리밍",
70
+ chainReactConferenceLink: "Chain React 컨퍼런스",
71
+ hireUsTitle: "다음 프로젝트에 Infinite Red 를 고용하세요",
72
+ hireUs:
73
+ "프로젝트 전체를 수행하든, 실무 교육을 통해 팀의 개발 속도에 박차를 가하든 상관없이, Infinite Red 는 React Native 프로젝트의 모든 분야의 에서 도움을 드릴 수 있습니다.",
74
+ hireUsLink: "메세지 보내기",
75
+ },
76
+ demoShowroomScreen: {
77
+ jumpStart: "프로젝트를 바로 시작할 수 있는 컴포넌트들!",
78
+ lorem2Sentences:
79
+ "별 하나에 추억과, 별 하나에 사랑과, 별 하나에 쓸쓸함과, 별 하나에 동경(憧憬)과, 별 하나에 시와, 별 하나에 어머니, 어머니",
80
+ demoHeaderTxExample: "야호",
81
+ demoViaTxProp: "`tx` Prop 을 통해",
82
+ demoViaSpecifiedTxProp: "`{{prop}}Tx` Prop 을 통해",
83
+ },
84
+ demoDebugScreen: {
85
+ howTo: "사용방법",
86
+ title: "디버그",
87
+ tagLine:
88
+ "축하합니다. 여기 아주 고급스러운 React Native 앱 템플릿이 있습니다. 이 보일러 플레이트를 사용해보세요!",
89
+ reactotron: "Reactotron 으로 보내기",
90
+ reportBugs: "버그 보고하기",
91
+ demoList: "데모 목록",
92
+ demoPodcastList: "데모 팟캐스트 목록",
93
+ androidReactotronHint:
94
+ "만약에 동작하지 않는 경우, Reactotron 데스크탑 앱이 실행중인지 확인 후, 터미널에서 adb reverse tcp:9090 tcp:9090 을 실행한 다음 앱을 다시 실행해보세요.",
95
+ iosReactotronHint:
96
+ "만약에 동작하지 않는 경우, Reactotron 데스크탑 앱이 실행중인지 확인 후 앱을 다시 실행해보세요.",
97
+ macosReactotronHint:
98
+ "만약에 동작하지 않는 경우, Reactotron 데스크탑 앱이 실행중인지 확인 후 앱을 다시 실행해보세요.",
99
+ webReactotronHint:
100
+ "만약에 동작하지 않는 경우, Reactotron 데스크탑 앱이 실행중인지 확인 후 앱을 다시 실행해보세요.",
101
+ windowsReactotronHint:
102
+ "만약에 동작하지 않는 경우, Reactotron 데스크탑 앱이 실행중인지 확인 후 앱을 다시 실행해보세요.",
103
+ },
104
+ demoPodcastListScreen: {
105
+ title: "React Native 라디오 에피소드",
106
+ onlyFavorites: "즐겨찾기만 보기",
107
+ favoriteButton: "즐겨찾기",
108
+ unfavoriteButton: "즐겨찾기 해제",
109
+ accessibility: {
110
+ cardHint:
111
+ "에피소드를 들으려면 두 번 탭하세요. 이 에피소드를 좋아하거나 싫어하려면 두 번 탭하고 길게 누르세요.",
112
+ switch: "즐겨찾기를 사용하려면 스위치를 사용하세요.",
113
+ favoriteAction: "즐겨찾기 토글",
114
+ favoriteIcon: "좋아하는 에피소드",
115
+ unfavoriteIcon: "즐겨찾기하지 않은 에피소드",
116
+ publishLabel: "{{date}} 에 발행됨",
117
+ durationLabel: "소요시간: {{hours}}시간 {{minutes}}분 {{seconds}}초",
118
+ },
119
+ noFavoritesEmptyState: {
120
+ heading: "조금 텅 비어 있네요.",
121
+ content: "즐겨찾기가 없습니다. 에피소드에 있는 하트를 눌러서 즐겨찾기에 추가하세요.",
122
+ },
123
+ },
124
+ // @demo remove-block-start
125
+ ...demoKo,
126
+ // @demo remove-block-end
127
+ }
128
+
129
+ export default ko
@@ -0,0 +1,33 @@
1
+ import i18n from "i18next"
2
+ import type { TOptions } from "i18next"
3
+
4
+ import { TxKeyPath } from "."
5
+
6
+ /**
7
+ * Translates text.
8
+ * @param {TxKeyPath} key - The i18n key.
9
+ * @param {TOptions} options - The i18n options.
10
+ * @returns {string} - The translated text.
11
+ * @example
12
+ * Translations:
13
+ *
14
+ * ```en.ts
15
+ * {
16
+ * "hello": "Hello, {{name}}!"
17
+ * }
18
+ * ```
19
+ *
20
+ * Usage:
21
+ * ```ts
22
+ * import { translate } from "./i18n"
23
+ *
24
+ * translate("hello", { name: "world" })
25
+ * // => "Hello world!"
26
+ * ```
27
+ */
28
+ export function translate(key: TxKeyPath, options?: TOptions): string {
29
+ if (i18n.isInitialized) {
30
+ return i18n.t(key, options)
31
+ }
32
+ return key
33
+ }
@@ -0,0 +1,2 @@
1
+ export * from './parse'
2
+ export { default } from './parse'
@@ -0,0 +1,62 @@
1
+ import { initializeParse } from "@parse/react-native"
2
+ import AsyncStorage from "@react-native-async-storage/async-storage"
3
+ import Parse from "parse/react-native"
4
+ import 'react-native-get-random-values';
5
+
6
+
7
+ // Runtime guard + type narrowing
8
+ const getEnv = (key: string): string => {
9
+ const v = process.env[key]
10
+ if (!v) throw new Error(`Missing required env var: ${key}`)
11
+ return v
12
+ }
13
+
14
+ // Parse server details (now guaranteed strings)
15
+ const PARSE_SERVER_URL = getEnv("EXPO_PUBLIC_SERVER_URL")
16
+ const PARSE_APP_ID = getEnv("EXPO_PUBLIC_APP_ID")
17
+ const PARSE_JS_KEY = getEnv("EXPO_PUBLIC_JAVASCRIPT_KEY")
18
+
19
+ // console.log("Initializing Parse with server URL:", PARSE_SERVER_URL)
20
+
21
+ // Initialize Parse with AsyncStorage for React Native
22
+ initializeParse(
23
+ PARSE_SERVER_URL,
24
+ PARSE_APP_ID,
25
+ PARSE_JS_KEY || 'undefined'
26
+ )
27
+
28
+ // Configure Parse only once
29
+ if (!Parse.applicationId) {
30
+ // @ts-ignore - serverURL is writeable at runtime
31
+ Parse.serverURL = PARSE_SERVER_URL
32
+ Parse.initialize(PARSE_APP_ID, PARSE_JS_KEY)
33
+
34
+ // Set AsyncStorage first
35
+ Parse.setAsyncStorage(AsyncStorage)
36
+
37
+ // Then enable local datastore
38
+ Parse.enableLocalDatastore()
39
+ }
40
+
41
+ // Type-safe wrapper functions
42
+ export const getCurrentUser = async (): Promise<Parse.User | null> => {
43
+ try {
44
+ return await Parse.User.currentAsync()
45
+ } catch (error) {
46
+ console.error("Error getting current user:", error)
47
+ return null
48
+ }
49
+ }
50
+
51
+ export const fetchAllUsers = async (): Promise<Parse.User[]> => {
52
+ try {
53
+ const query = new Parse.Query('_User')
54
+ const results = await query.find()
55
+ return results as unknown as Parse.User[]
56
+ } catch (error) {
57
+ console.error("Error fetching users:", error)
58
+ return []
59
+ }
60
+ }
61
+
62
+ export default Parse
@@ -0,0 +1,145 @@
1
+ /**
2
+ * The app navigator (formerly "AppNavigator" and "MainNavigator") is used for the primary
3
+ * navigation flows of your app.
4
+ * Generally speaking, it will contain an auth flow (registration, login, forgot password)
5
+ * and a "main" flow which the user will use once logged in.
6
+ */
7
+ import React,{ ComponentProps, useEffect } from "react"
8
+ import {
9
+ NavigationContainer,
10
+ NavigatorScreenParams, // @demo remove-current-line
11
+ } from "@react-navigation/native"
12
+ import { createNativeStackNavigator, NativeStackScreenProps } from "@react-navigation/native-stack"
13
+
14
+ import Config from "@/config"
15
+ import { useAuth } from "@/context/AuthContext" // @demo remove-current-line
16
+ import { ErrorBoundary } from "@/screens/ErrorScreen/ErrorBoundary"
17
+ import { LoginScreen } from "@/screens/LoginScreen" // @demo remove-current-line
18
+ import { WelcomeScreen } from "@/screens/WelcomeScreen"
19
+ import { RegisterScreen } from "@/screens/RegisterScreen" // @demo remove-current-line
20
+ import { ChooseAuthScreen } from "@/screens/ChooseAuthScreen" // @demo remove-current-line
21
+ import { ForgetPasswordScreen } from "@/screens/ForgetPasswordScreen"
22
+ import { useAppTheme } from "@/theme/context"
23
+
24
+
25
+ import { DemoNavigator, DemoTabParamList } from "./DemoNavigator" // @demo remove-current-line
26
+ import { navigationRef, useBackButtonHandler } from "./navigationUtilities"
27
+ import { Alert } from "react-native"
28
+ import { showQueuedAlert } from "@/components"
29
+
30
+
31
+ /**
32
+ * This type allows TypeScript to know what routes are defined in this navigator
33
+ * as well as what properties (if any) they might take when navigating to them.
34
+ *
35
+ * For more information, see this documentation:
36
+ * https://reactnavigation.org/docs/params/
37
+ * https://reactnavigation.org/docs/typescript#type-checking-the-navigator
38
+ * https://reactnavigation.org/docs/typescript/#organizing-types
39
+ */
40
+ export type AppStackParamList = {
41
+ Welcome: undefined
42
+ Login: undefined // @demo remove-current-line
43
+ Demo: NavigatorScreenParams<DemoTabParamList> // @demo remove-current-line
44
+ // 🔥 Your screens go here
45
+ Register: undefined
46
+ ChooseAuth: undefined
47
+ ForgetPassword: undefined
48
+ // IGNITE_GENERATOR_ANCHOR_APP_STACK_PARAM_LIST
49
+ }
50
+
51
+ /**
52
+ * This is a list of all the route names that will exit the app if the back button
53
+ * is pressed while in that screen. Only affects Android.
54
+ */
55
+ const exitRoutes = Config.exitRoutes
56
+
57
+ export type AppStackScreenProps<T extends keyof AppStackParamList> = NativeStackScreenProps<
58
+ AppStackParamList,
59
+ T
60
+ >
61
+
62
+ // Documentation: https://reactnavigation.org/docs/stack-navigator/
63
+ const Stack = createNativeStackNavigator<AppStackParamList>()
64
+
65
+ const AppStack = () => {
66
+ // @demo remove-block-start
67
+ const { isAuthenticated,checkServerStatus } = useAuth()
68
+ // @demo remove-block-end
69
+ const {
70
+ theme: { colors },
71
+ } = useAppTheme()
72
+
73
+ useEffect(() => {
74
+ const checkStatus = async () => {
75
+ const status = await checkServerStatus();
76
+ if (!status.isRunning) {
77
+ showQueuedAlert({
78
+ title: "No connection",
79
+ message: status.message,
80
+
81
+ })
82
+ }
83
+ };
84
+
85
+ // Initial check
86
+ checkStatus();
87
+
88
+ // Set up interval for periodic checks (every 30 seconds)
89
+ const intervalId = setInterval(checkStatus, 30000);
90
+
91
+ // Clean up the interval when the component unmounts or when checkServerStatus changes
92
+ return () => clearInterval(intervalId);
93
+ }, [checkServerStatus])
94
+
95
+ return (
96
+ <Stack.Navigator
97
+ screenOptions={{
98
+ headerShown: false,
99
+ navigationBarColor: colors.background,
100
+ contentStyle: {
101
+ backgroundColor: colors.background,
102
+ },
103
+ }}
104
+ initialRouteName={isAuthenticated ? "Demo" : "Welcome"} // @demo remove-current-line
105
+ >
106
+ {/* @demo remove-block-start */}
107
+ {isAuthenticated ? (
108
+ <>
109
+ {/* @demo remove-block-end */}
110
+
111
+ {/* @demo remove-block-start */}
112
+ <Stack.Screen name="Demo" component={DemoNavigator} />
113
+ </>
114
+ ) : (
115
+ <>
116
+ <Stack.Screen name="Welcome" component={WelcomeScreen} />
117
+ <Stack.Screen name="ChooseAuth" component={ChooseAuthScreen} />
118
+ <Stack.Screen name="Login" component={LoginScreen} />
119
+ <Stack.Screen name="Register" component={RegisterScreen} />
120
+ <Stack.Screen name="ForgetPassword" component={ForgetPasswordScreen} />
121
+ </>
122
+ )}
123
+ {/* @demo remove-block-end */}
124
+ {/** 🔥 Your screens go here */}
125
+ {/* IGNITE_GENERATOR_ANCHOR_APP_STACK_SCREENS */}
126
+ </Stack.Navigator>
127
+ )
128
+ }
129
+
130
+ export interface NavigationProps
131
+ extends Partial<ComponentProps<typeof NavigationContainer<AppStackParamList>>> {}
132
+
133
+ export const AppNavigator = (props: NavigationProps) => {
134
+ const { navigationTheme } = useAppTheme()
135
+
136
+ useBackButtonHandler((routeName) => exitRoutes.includes(routeName))
137
+
138
+ return (
139
+ <NavigationContainer ref={navigationRef} theme={navigationTheme} {...props}>
140
+ <ErrorBoundary catchErrors={Config.catchErrors}>
141
+ <AppStack />
142
+ </ErrorBoundary>
143
+ </NavigationContainer>
144
+ )
145
+ }
@@ -0,0 +1,137 @@
1
+ import { TextStyle, ViewStyle } from "react-native"
2
+ import { BottomTabScreenProps, createBottomTabNavigator } from "@react-navigation/bottom-tabs"
3
+ import { CompositeScreenProps } from "@react-navigation/native"
4
+ import { useSafeAreaInsets } from "react-native-safe-area-context"
5
+
6
+ import { Icon } from "@/components/Icon"
7
+ import { EpisodeProvider } from "@/context/EpisodeContext"
8
+ import { translate } from "@/i18n/translate"
9
+ import { DemoCommunityScreen } from "@/screens/DemoCommunityScreen"
10
+ import { DemoDebugScreen } from "@/screens/DemoDebugScreen"
11
+ import { DemoPodcastListScreen } from "@/screens/DemoPodcastListScreen"
12
+ import { DemoShowroomScreen } from "@/screens/DemoShowroomScreen/DemoShowroomScreen"
13
+ import type { ThemedStyle } from "@/theme/types"
14
+ import { useAppTheme } from "@/theme/context"
15
+
16
+ import { AppStackParamList, AppStackScreenProps } from "./AppNavigator"
17
+
18
+ export type DemoTabParamList = {
19
+ DemoCommunity: undefined
20
+ DemoShowroom: { queryIndex?: string; itemIndex?: string }
21
+ DemoDebug: undefined
22
+ DemoPodcastList: undefined
23
+ }
24
+
25
+ /**
26
+ * Helper for automatically generating navigation prop types for each route.
27
+ *
28
+ * More info: https://reactnavigation.org/docs/typescript/#organizing-types
29
+ */
30
+ export type DemoTabScreenProps<T extends keyof DemoTabParamList> = CompositeScreenProps<
31
+ BottomTabScreenProps<DemoTabParamList, T>,
32
+ AppStackScreenProps<keyof AppStackParamList>
33
+ >
34
+
35
+ const Tab = createBottomTabNavigator<DemoTabParamList>()
36
+
37
+ /**
38
+ * This is the main navigator for the demo screens with a bottom tab bar.
39
+ * Each tab is a stack navigator with its own set of screens.
40
+ *
41
+ * More info: https://reactnavigation.org/docs/bottom-tab-navigator/
42
+ * @returns {JSX.Element} The rendered `DemoNavigator`.
43
+ */
44
+ export function DemoNavigator() {
45
+ const { bottom } = useSafeAreaInsets()
46
+ const {
47
+ themed,
48
+ theme: { colors },
49
+ } = useAppTheme()
50
+
51
+ return (
52
+ <EpisodeProvider>
53
+ <Tab.Navigator
54
+ screenOptions={{
55
+ headerShown: false,
56
+ tabBarHideOnKeyboard: true,
57
+ tabBarStyle: themed([$tabBar, { height: bottom + 70 }]),
58
+ tabBarActiveTintColor: colors.text,
59
+ tabBarInactiveTintColor: colors.text,
60
+ tabBarLabelStyle: themed($tabBarLabel),
61
+ tabBarItemStyle: themed($tabBarItem),
62
+ }}
63
+ >
64
+ <Tab.Screen
65
+ name="DemoShowroom"
66
+ component={DemoShowroomScreen}
67
+ options={{
68
+ tabBarLabel: translate("demoNavigator:componentsTab"),
69
+ tabBarIcon: ({ focused }) => (
70
+ <Icon
71
+ icon="components"
72
+ color={focused ? colors.tint : colors.tintInactive}
73
+ size={30}
74
+ />
75
+ ),
76
+ }}
77
+ />
78
+
79
+ <Tab.Screen
80
+ name="DemoCommunity"
81
+ component={DemoCommunityScreen}
82
+ options={{
83
+ tabBarLabel: translate("demoNavigator:communityTab"),
84
+ tabBarIcon: ({ focused }) => (
85
+ <Icon
86
+ icon="community"
87
+ color={focused ? colors.tint : colors.tintInactive}
88
+ size={30}
89
+ />
90
+ ),
91
+ }}
92
+ />
93
+
94
+ <Tab.Screen
95
+ name="DemoPodcastList"
96
+ component={DemoPodcastListScreen}
97
+ options={{
98
+ tabBarAccessibilityLabel: translate("demoNavigator:podcastListTab"),
99
+ tabBarLabel: translate("demoNavigator:podcastListTab"),
100
+ tabBarIcon: ({ focused }) => (
101
+ <Icon icon="podcast" color={focused ? colors.tint : colors.tintInactive} size={30} />
102
+ ),
103
+ }}
104
+ />
105
+
106
+ <Tab.Screen
107
+ name="DemoDebug"
108
+ component={DemoDebugScreen}
109
+ options={{
110
+ tabBarLabel: translate("demoNavigator:debugTab"),
111
+ tabBarIcon: ({ focused }) => (
112
+ <Icon icon="debug" color={focused ? colors.tint : colors.tintInactive} size={30} />
113
+ ),
114
+ }}
115
+ />
116
+ </Tab.Navigator>
117
+ </EpisodeProvider>
118
+ )
119
+ }
120
+
121
+ const $tabBar: ThemedStyle<ViewStyle> = ({ colors }) => ({
122
+ backgroundColor: colors.background,
123
+ borderTopColor: colors.transparent,
124
+ })
125
+
126
+ const $tabBarItem: ThemedStyle<ViewStyle> = ({ spacing }) => ({
127
+ paddingTop: spacing.md,
128
+ })
129
+
130
+ const $tabBarLabel: ThemedStyle<TextStyle> = ({ colors, typography }) => ({
131
+ fontSize: 12,
132
+ fontFamily: typography.primary.medium,
133
+ lineHeight: 16,
134
+ color: colors.text,
135
+ })
136
+
137
+ // @demo remove-file