You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

screenOptions.js 6.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265
  1. import { TransitionPresets } from '@react-navigation/stack';
  2. import React from 'react';
  3. import { Platform } from 'react-native';
  4. import {
  5. Icon,
  6. IconHelp,
  7. IconHome,
  8. IconInfo,
  9. IconSettings
  10. } from '../../base/icons';
  11. import BaseTheme from '../../base/ui/components/BaseTheme.native';
  12. import { goBack } from './components/conference/ConferenceNavigationContainerRef';
  13. import { goBack as goBackToLobbyScreen } from './components/lobby/LobbyNavigationContainerRef';
  14. import { screenHeaderCloseButton } from './functions';
  15. /**
  16. * Navigation container theme.
  17. */
  18. export const navigationContainerTheme = {
  19. colors: {
  20. background: BaseTheme.palette.ui12
  21. }
  22. };
  23. /**
  24. * Default modal transition for the current platform.
  25. */
  26. export const conferenceModalPresentation = Platform.select({
  27. ios: TransitionPresets.ModalPresentationIOS,
  28. default: TransitionPresets.DefaultTransition
  29. });
  30. /**
  31. * Screen options and transition types.
  32. */
  33. export const fullScreenOptions = {
  34. ...TransitionPresets.ModalTransition,
  35. gestureEnabled: false,
  36. headerShown: false
  37. };
  38. /**
  39. * Drawer navigator screens options and transition types.
  40. */
  41. export const drawerNavigatorScreenOptions = {
  42. ...TransitionPresets.ModalTransition,
  43. gestureEnabled: true,
  44. headerShown: false
  45. };
  46. /**
  47. * Drawer screen options and transition types.
  48. */
  49. export const drawerScreenOptions = {
  50. ...TransitionPresets.ModalTransition,
  51. gestureEnabled: true,
  52. headerShown: true,
  53. headerStyle: {
  54. backgroundColor: BaseTheme.palette.screen02Header
  55. }
  56. };
  57. /**
  58. * Drawer content options.
  59. */
  60. export const drawerContentOptions = {
  61. drawerActiveBackgroundColor: BaseTheme.palette.uiBackground,
  62. drawerActiveTintColor: BaseTheme.palette.screen01Header,
  63. drawerInactiveTintColor: BaseTheme.palette.text02,
  64. drawerLabelStyle: {
  65. marginLeft: BaseTheme.spacing[2]
  66. },
  67. drawerStyle: {
  68. backgroundColor: BaseTheme.palette.uiBackground,
  69. maxWidth: 400,
  70. width: '75%'
  71. }
  72. };
  73. /**
  74. * Screen options for welcome page.
  75. */
  76. export const welcomeScreenOptions = {
  77. ...drawerScreenOptions,
  78. drawerIcon: ({ focused }) => (
  79. <Icon
  80. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.icon02 }
  81. size = { 20 }
  82. src = { IconHome } />
  83. ),
  84. headerStyle: {
  85. backgroundColor: BaseTheme.palette.screen01Header
  86. },
  87. // eslint-disable-next-line no-empty-function
  88. headerTitle: () => {}
  89. };
  90. /**
  91. * Screen options for settings screen.
  92. */
  93. export const settingsScreenOptions = {
  94. ...drawerScreenOptions,
  95. drawerIcon: ({ focused }) => (
  96. <Icon
  97. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.icon02 }
  98. size = { 20 }
  99. src = { IconSettings } />
  100. ),
  101. headerTitleStyle: {
  102. color: BaseTheme.palette.text01
  103. }
  104. };
  105. /**
  106. * Screen options for terms/privacy screens.
  107. */
  108. export const termsAndPrivacyScreenOptions = {
  109. ...drawerScreenOptions,
  110. drawerIcon: ({ focused }) => (
  111. <Icon
  112. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.icon02 }
  113. size = { 20 }
  114. src = { IconInfo } />
  115. ),
  116. headerTitleStyle: {
  117. color: BaseTheme.palette.text01
  118. }
  119. };
  120. /**
  121. * Screen options for help screen.
  122. */
  123. export const helpScreenOptions = {
  124. ...drawerScreenOptions,
  125. drawerIcon: ({ focused }) => (
  126. <Icon
  127. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.icon02 }
  128. size = { 20 }
  129. src = { IconHelp } />
  130. ),
  131. headerTitleStyle: {
  132. color: BaseTheme.palette.text01
  133. }
  134. };
  135. /**
  136. * Screen options for conference.
  137. */
  138. export const conferenceScreenOptions = fullScreenOptions;
  139. /**
  140. * Tab bar options for chat screen.
  141. */
  142. export const chatTabBarOptions = {
  143. tabBarActiveTintColor: BaseTheme.palette.screen01Header,
  144. tabBarLabelStyle: {
  145. fontSize: BaseTheme.typography.labelRegular.fontSize
  146. },
  147. tabBarInactiveTintColor: BaseTheme.palette.text01,
  148. tabBarIndicatorStyle: {
  149. backgroundColor: BaseTheme.palette.screen01Header
  150. }
  151. };
  152. /**
  153. * Screen options for presentation type modals.
  154. */
  155. export const presentationScreenOptions = {
  156. ...conferenceModalPresentation,
  157. headerBackTitleVisible: false,
  158. headerLeft: () => screenHeaderCloseButton(goBack),
  159. headerStatusBarHeight: 0,
  160. headerStyle: {
  161. backgroundColor: BaseTheme.palette.screen02Header
  162. },
  163. headerTitleStyle: {
  164. color: BaseTheme.palette.text01
  165. }
  166. };
  167. /**
  168. * Screen options for chat.
  169. */
  170. export const chatScreenOptions = presentationScreenOptions;
  171. /**
  172. * Dial-IN Info screen options and transition types.
  173. */
  174. export const dialInSummaryScreenOptions = {
  175. ...presentationScreenOptions,
  176. headerLeft: undefined
  177. };
  178. /**
  179. * Screen options for invite modal.
  180. */
  181. export const inviteScreenOptions = presentationScreenOptions;
  182. /**
  183. * Screen options for participants modal.
  184. */
  185. export const participantsScreenOptions = presentationScreenOptions;
  186. /**
  187. * Screen options for speaker stats modal.
  188. */
  189. export const speakerStatsScreenOptions = presentationScreenOptions;
  190. /**
  191. * Screen options for security options modal.
  192. */
  193. export const securityScreenOptions = presentationScreenOptions;
  194. /**
  195. * Screen options for recording modal.
  196. */
  197. export const recordingScreenOptions = presentationScreenOptions;
  198. /**
  199. * Screen options for live stream modal.
  200. */
  201. export const liveStreamScreenOptions = presentationScreenOptions;
  202. /**
  203. * Screen options for lobby modal.
  204. */
  205. export const lobbyScreenOptions = presentationScreenOptions;
  206. /**
  207. * Screen options for lobby chat modal.
  208. */
  209. export const lobbyChatScreenOptions = {
  210. ...presentationScreenOptions,
  211. headerLeft: () => screenHeaderCloseButton(goBackToLobbyScreen)
  212. };
  213. /**
  214. * Screen options for salesforce link modal.
  215. */
  216. export const salesforceScreenOptions = presentationScreenOptions;
  217. /**
  218. * Screen options for GIPHY integration modal.
  219. */
  220. export const gifsMenuOptions = presentationScreenOptions;
  221. /**
  222. * Screen options for shared document.
  223. */
  224. export const sharedDocumentScreenOptions = {
  225. ...TransitionPresets.DefaultTransition,
  226. headerBackTitleVisible: false,
  227. headerShown: true,
  228. headerStyle: {
  229. backgroundColor: BaseTheme.palette.screen02Header
  230. },
  231. headerTitleStyle: {
  232. color: BaseTheme.palette.text01
  233. }
  234. };