Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

screenOptions.js 6.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275
  1. // @flow
  2. /* eslint-disable react/no-multi-comp */
  3. import { TransitionPresets } from '@react-navigation/stack';
  4. import React from 'react';
  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';
  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.ui12,
  78. drawerActiveTintColor: BaseTheme.palette.screen01Header,
  79. drawerLabelStyle: {
  80. marginLeft: BaseTheme.spacing[2]
  81. },
  82. drawerStyle: {
  83. backgroundColor: BaseTheme.palette.ui12,
  84. maxWidth: 400,
  85. width: '75%'
  86. }
  87. };
  88. /**
  89. * Screen options for welcome page.
  90. */
  91. export const welcomeScreenOptions = {
  92. ...drawerScreenOptions,
  93. drawerIcon: ({ focused }) => (
  94. <Icon
  95. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.field01Disabled }
  96. size = { 20 }
  97. src = { IconHome } />
  98. ),
  99. headerTitleStyle: {
  100. color: BaseTheme.palette.screen01Header
  101. }
  102. };
  103. /**
  104. * Screen options for settings screen.
  105. */
  106. export const settingsScreenOptions = {
  107. ...drawerScreenOptions,
  108. drawerIcon: ({ focused }) => (
  109. <Icon
  110. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.field01Disabled }
  111. size = { 20 }
  112. src = { IconSettings } />
  113. ),
  114. headerTitleStyle: {
  115. color: BaseTheme.palette.text01
  116. }
  117. };
  118. /**
  119. * Screen options for terms/privacy screens.
  120. */
  121. export const termsAndPrivacyScreenOptions = {
  122. ...drawerScreenOptions,
  123. drawerIcon: ({ focused }) => (
  124. <Icon
  125. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.field01Disabled }
  126. size = { 20 }
  127. src = { IconInfo } />
  128. ),
  129. headerTitleStyle: {
  130. color: BaseTheme.palette.text01
  131. }
  132. };
  133. /**
  134. * Screen options for help screen.
  135. */
  136. export const helpScreenOptions = {
  137. ...drawerScreenOptions,
  138. drawerIcon: ({ focused }) => (
  139. <Icon
  140. color = { focused ? BaseTheme.palette.screen01Header : BaseTheme.palette.field01Disabled }
  141. size = { 20 }
  142. src = { IconHelp } />
  143. ),
  144. headerTitleStyle: {
  145. color: BaseTheme.palette.text01
  146. }
  147. };
  148. /**
  149. * Screen options for conference.
  150. */
  151. export const conferenceScreenOptions = {
  152. ...fullScreenOptions
  153. };
  154. /**
  155. * Screen options for lobby modal.
  156. */
  157. export const lobbyScreenOptions = {
  158. ...fullScreenOptions
  159. };
  160. /**
  161. * Tab bar options for chat screen.
  162. */
  163. export const chatTabBarOptions = {
  164. tabBarActiveTintColor: BaseTheme.palette.screen01Header,
  165. tabBarLabelStyle: {
  166. fontSize: BaseTheme.typography.labelRegular.fontSize
  167. },
  168. tabBarInactiveTintColor: BaseTheme.palette.field02Disabled,
  169. tabBarIndicatorStyle: {
  170. backgroundColor: BaseTheme.palette.screen01Header
  171. }
  172. };
  173. /**
  174. * Screen options for presentation type modals.
  175. */
  176. export const presentationScreenOptions = {
  177. ...conferenceModalPresentation,
  178. headerBackTitleVisible: false,
  179. headerLeft: () => (
  180. <HeaderNavigationButton
  181. onPress = { goBack }
  182. src = { IconClose } />
  183. ),
  184. headerStatusBarHeight: 0,
  185. headerStyle: {
  186. backgroundColor: BaseTheme.palette.screen01Header
  187. },
  188. headerTitleStyle: {
  189. color: BaseTheme.palette.text01
  190. }
  191. };
  192. /**
  193. * Screen options for chat.
  194. */
  195. export const chatScreenOptions = {
  196. ...presentationScreenOptions
  197. };
  198. /**
  199. * Screen options for invite modal.
  200. */
  201. export const inviteScreenOptions = {
  202. ...presentationScreenOptions
  203. };
  204. /**
  205. * Screen options for participants modal.
  206. */
  207. export const participantsScreenOptions = {
  208. ...presentationScreenOptions
  209. };
  210. /**
  211. * Screen options for speaker stats modal.
  212. */
  213. export const speakerStatsScreenOptions = {
  214. ...presentationScreenOptions
  215. };
  216. /**
  217. * Screen options for security options modal.
  218. */
  219. export const securityScreenOptions = {
  220. ...presentationScreenOptions
  221. };
  222. /**
  223. * Screen options for recording modal.
  224. */
  225. export const recordingScreenOptions = {
  226. ...presentationScreenOptions
  227. };
  228. /**
  229. * Screen options for live stream modal.
  230. */
  231. export const liveStreamScreenOptions = {
  232. ...presentationScreenOptions
  233. };
  234. /**
  235. * Screen options for shared document.
  236. */
  237. export const sharedDocumentScreenOptions = {
  238. ...TransitionPresets.DefaultTransition,
  239. headerBackTitleVisible: false,
  240. headerShown: true,
  241. headerStyle: {
  242. backgroundColor: BaseTheme.palette.screen01Header
  243. },
  244. headerTitleStyle: {
  245. color: BaseTheme.palette.text01
  246. }
  247. };