-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from naeem2000/dev
Dev
- Loading branch information
Showing
44 changed files
with
22,272 additions
and
1,361 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,67 @@ | ||
# OSX | ||
# | ||
.DS_Store | ||
.vscode | ||
|
||
# Xcode | ||
# | ||
build/ | ||
*.pbxuser | ||
!default.pbxuser | ||
*.mode1v3 | ||
!default.mode1v3 | ||
*.mode2v3 | ||
!default.mode2v3 | ||
*.perspectivev3 | ||
!default.perspectivev3 | ||
xcuserdata | ||
*.xccheckout | ||
*.moved-aside | ||
DerivedData | ||
*.hmap | ||
*.ipa | ||
*.xcuserstate | ||
ios/.xcode.env.local | ||
|
||
# Android/IntelliJ | ||
# | ||
build/ | ||
.idea | ||
.gradle | ||
local.properties | ||
*.iml | ||
*.hprof | ||
.cxx/ | ||
*.keystore | ||
!debug.keystore | ||
|
||
# node.js | ||
# | ||
node_modules | ||
npm-debug.log | ||
yarn-error.log | ||
|
||
# fastlane | ||
# | ||
# It is recommended to not store the screenshots in the git repo. Instead, use fastlane to re-generate the | ||
# screenshots whenever they are needed. | ||
# For more information about the recommended setup visit: | ||
# https://docs.fastlane.tools/best-practices/source-control/ | ||
|
||
**/fastlane/report.xml | ||
**/fastlane/Preview.html | ||
**/fastlane/screenshots | ||
**/fastlane/test_output | ||
|
||
# Bundle artifact | ||
*.jsbundle | ||
|
||
# Ruby / CocoaPods | ||
/ios/Pods/ | ||
/vendor/bundle/ | ||
|
||
# Temporary files created by Metro to check the health of the file watcher | ||
.metro-health-check* | ||
|
||
# testing | ||
/coverage |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,55 @@ | ||
import NetInfo from '@react-native-community/netinfo'; | ||
import React, {useState, useEffect} from 'react'; | ||
import {StyleSheet} from 'react-native'; | ||
import React, { useState, useEffect } from 'react'; | ||
import { StyleSheet } from 'react-native'; | ||
import Lottie from 'lottie-react-native'; | ||
|
||
export default function OfflineNotice() { | ||
const [isConnected, setIsConnected] = useState<boolean>(false); | ||
const [isConnected, setIsConnected] = useState<boolean>(false); | ||
|
||
useEffect(() => { | ||
NetInfo.addEventListener(handleConnectivityChange); | ||
NetInfo.fetch().then((state: any) => { | ||
setIsConnected(state.isConnected); | ||
}); | ||
useEffect(() => { | ||
NetInfo.addEventListener(handleConnectivityChange); | ||
NetInfo.fetch().then((state: any) => { | ||
setIsConnected(state.isConnected); | ||
}); | ||
|
||
return () => { | ||
NetInfo.addEventListener((state: any) => { | ||
setIsConnected(state.isConnected); | ||
}); | ||
}; | ||
}, [NetInfo]); | ||
return () => { | ||
NetInfo.addEventListener((state: any) => { | ||
setIsConnected(state.isConnected); | ||
}); | ||
}; | ||
}, [NetInfo]); | ||
|
||
function handleConnectivityChange(state: any) { | ||
if (state.isConnected) { | ||
setIsConnected(true); | ||
} else { | ||
setIsConnected(false); | ||
} | ||
} | ||
function handleConnectivityChange(state: any) { | ||
if (state.isConnected) { | ||
setIsConnected(true); | ||
} else { | ||
setIsConnected(false); | ||
} | ||
} | ||
|
||
function MiniOfflineSign() { | ||
return ( | ||
<Lottie | ||
source={require('../Assets/142259-offline-dgaccel.json')} | ||
autoPlay | ||
loop | ||
style={styles.offlineContainer} | ||
/> | ||
); | ||
} | ||
function MiniOfflineSign() { | ||
return ( | ||
<Lottie | ||
source={require('../Assets/142259-offline-dgaccel.json')} | ||
autoPlay | ||
loop | ||
style={styles.offlineContainer} | ||
/> | ||
); | ||
} | ||
|
||
if (!isConnected) { | ||
return <MiniOfflineSign />; | ||
} | ||
return null; | ||
if (!isConnected) { | ||
return <MiniOfflineSign />; | ||
} | ||
return null; | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
offlineContainer: { | ||
position: 'absolute', | ||
top: 32, | ||
alignSelf: 'center', | ||
height: 50, | ||
zIndex: 999, | ||
}, | ||
offlineContainer: { | ||
position: 'absolute', | ||
top: 32, | ||
alignSelf: 'center', | ||
height: 50, | ||
zIndex: 999, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import { getFirestore, Firestore } from 'firebase/firestore'; | ||
import { initializeApp, getApps } from 'firebase/app'; | ||
import { getAuth, Auth } from 'firebase/auth'; | ||
import { firebaseKeys } from '../constants'; | ||
|
||
const firebaseConfig = { | ||
apiKey: firebaseKeys.apiKey, | ||
authDomain: firebaseKeys.authDomain, | ||
projectId: firebaseKeys.projectId, | ||
storageBucket: firebaseKeys.storageBucket, | ||
messagingSenderId: firebaseKeys.messagingSenderId, | ||
appId: firebaseKeys.appId, | ||
}; | ||
|
||
const app = !getApps().length ? initializeApp(firebaseConfig) : getApps()[0]; | ||
|
||
export const authGlobal: Auth = getAuth(app); | ||
export const firestore: Firestore = getFirestore(app); | ||
|
||
export const auth: Auth = getAuth(app); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
export const firebaseKeys = { | ||
apiKey: 'AIzaSyDHswY5ZZZQuqFSKXIUuhJO64KE4i8_wQM', | ||
authDomain: 'cerebral-twist.firebaseapp.com', | ||
projectId: 'cerebral-twist', | ||
storageBucket: 'cerebral-twist.appspot.com', | ||
messagingSenderId: '888534795197', | ||
appId: '1:888534795197:web:f41aae1ea17fa4fc1f08d4', | ||
}; |
Oops, something went wrong.