File tree Expand file tree Collapse file tree 4 files changed +40
-1
lines changed
Expand file tree Collapse file tree 4 files changed +40
-1
lines changed Original file line number Diff line number Diff line change @@ -7,7 +7,7 @@ import { EnhancedStore } from '@reduxjs/toolkit'
77import React , { useEffect , useState } from 'react'
88import { I18nextProvider } from 'react-i18next'
99import { Provider } from 'react-redux'
10- import { LoadingScreen } from '@/components'
10+ import { MaintenanceScreen , LoadingScreen } from '@/components'
1111// eslint-disable-next-line camelcase
1212import { useFonts , Inter_400Regular } from '@expo-google-fonts/inter'
1313import RootContainer from '@/components/RootContainer'
@@ -82,6 +82,10 @@ const RootLayout = () => {
8282 return < LoadingScreen />
8383 }
8484
85+ if ( process . env . EXPO_PUBLIC_MAINTENANCE_MODE === 'true' ) {
86+ return < MaintenanceScreen />
87+ }
88+
8589 let backgroundColor = getThemeStyle ( colorScheme , 'backgroundColor' )
8690
8791 return (
Original file line number Diff line number Diff line change 1+ import React from 'react'
2+ import { Text , View } from 'react-native'
3+ import RootContainer from './RootContainer'
4+ import RootImageBackground from './RootImageBackground'
5+ import { LogoIcon } from './svg'
6+
7+ const MaintenanceScreen : React . FC = ( ) => {
8+ return (
9+ < RootContainer >
10+ < RootImageBackground >
11+ < View className = 'flex-1' >
12+ < View className = 'w-full p-8 items-center justify-start gap-4' >
13+ < LogoIcon />
14+ < Text className = 'text-center text-white text-xl' style = { { fontFamily : 'Inter' } } >
15+ Ansari Chat is currently under maintenance.
16+ </ Text >
17+ < Text className = 'text-center text-white text-xl' style = { { fontFamily : 'Inter' } } >
18+ We are working hard to bring you the best experience possible.
19+ </ Text >
20+ < Text className = 'text-center text-white text-xl' style = { { fontFamily : 'Inter' } } >
21+ Thank you for your patience!
22+ </ Text >
23+ </ View >
24+ </ View >
25+ </ RootImageBackground >
26+ </ RootContainer >
27+ )
28+ }
29+
30+ export default MaintenanceScreen
Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ export { default as ConfirmationDialog } from './ConfirmationDialog'
22export { default as Footer } from './Footer'
33export { default as Header } from './Header'
44export { default as LoadingScreen } from './LoadingScreen'
5+ export { default as MaintenanceScreen } from './MaintenanceScreen'
56export { default as Subscription } from './Subscription'
67export { default as Toast } from './Toast'
78export { default as ChatContainer } from './chat/ChatContainer'
Original file line number Diff line number Diff line change @@ -130,6 +130,10 @@ export async function loadAuthState() {
130130 } >
131131 }
132132
133+ if ( process . env . EXPO_PUBLIC_MAINTENANCE_MODE === 'true' ) {
134+ return createAuthState ( initialAuthState )
135+ }
136+
133137 const apiService = new ApiService ( )
134138 const baseURL = process . env . EXPO_PUBLIC_API_V2_URL
135139 let accessToken = await apiService . getAccessTokenFromStorage ( )
You can’t perform that action at this time.
0 commit comments