This repository has been archived by the owner on Jan 20, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6e89a5e
commit fecfcf0
Showing
5 changed files
with
107 additions
and
1 deletion.
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
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
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
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,75 @@ | ||
/* React, React Native imports */ | ||
|
||
import React, { useEffect } from 'react'; | ||
import { | ||
Image, | ||
Text, | ||
useColorScheme, | ||
View, | ||
Button | ||
} from 'react-native'; | ||
|
||
/* Third party libraries */ | ||
|
||
import NetInfo from "@react-native-community/netinfo"; | ||
|
||
/* Local functions and variables */ | ||
|
||
import { colors } from '../Pages'; | ||
|
||
import { | ||
styles, | ||
} from "../Pages"; | ||
|
||
/* Root component */ | ||
|
||
export function OfflinePage({ navigation }) { | ||
const colorScheme = useColorScheme(); | ||
|
||
useEffect(() => { | ||
NetInfo.addEventListener(state => { | ||
if (state.isConnected) { | ||
navigation.navigate("Home"); | ||
} | ||
}); | ||
}); | ||
|
||
return ( | ||
<View | ||
style={{ | ||
padding: 25, | ||
flex: 1, | ||
backgroundColor: | ||
colorScheme === 'dark' ? colors.darkContent : colors.lightContent, | ||
}} | ||
> | ||
<Image | ||
style={styles.aboutImg} | ||
source={{ | ||
uri: 'https://raw.githubusercontent.com/aperta-principium/Interclip/main/img/interclip_logo.png', | ||
}} | ||
alt="Interclip logo" | ||
/> | ||
<Text | ||
style={{ | ||
color: colorScheme === 'dark' ? 'white' : 'black', | ||
fontSize: 20, | ||
textAlign: 'center' | ||
}} | ||
> | ||
It looks like you're offline... | ||
</Text> | ||
<Text | ||
style={{ | ||
color: colorScheme === 'dark' ? 'white' : 'black', | ||
marginTop: 35, | ||
fontSize: 14, | ||
textAlign: 'center' | ||
}} | ||
> | ||
I can't help you with that, but you can try refreshing after you're connected. | ||
</Text> | ||
<Button title="Refresh" onPress={() => {navigation.navigate("Home")}} /> | ||
</View> | ||
); | ||
} |
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