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.7KB

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