-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EXPO 37. expo-Fonts. React-navigation for header and drawer
- Loading branch information
1 parent
f03f84a
commit f01749a
Showing
99 changed files
with
1,928 additions
and
647 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 |
---|---|---|
@@ -1,9 +1,16 @@ | ||
node_modules/**/* | ||
.expo/* | ||
.idea | ||
npm-debug.* | ||
*.jks | ||
*.p8 | ||
*.p12 | ||
*.key | ||
*.mobileprovision | ||
env.js | ||
*.orig.* | ||
web-build/ | ||
web-report/ | ||
env.* | ||
app.json | ||
|
||
# macOS | ||
.DS_Store |
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,41 @@ | ||
import React from "react"; | ||
import { StyleSheet, View } from "react-native"; | ||
import { Video } from "expo-av"; | ||
|
||
export default function Background(props) { | ||
let source = require("../assets/back-blur-3.mp4"); | ||
return ( | ||
<View style={styles.container}> | ||
<Video | ||
source={source} | ||
rate={1.0} | ||
volume={1.0} | ||
isMuted={false} | ||
resizeMode="cover" | ||
shouldPlay | ||
isLooping | ||
style={styles.backgroundVideo} | ||
/> | ||
{props.children} | ||
</View> | ||
); | ||
} | ||
|
||
const styles = StyleSheet.create({ | ||
container: { | ||
flex: 1, | ||
// marginTop: 50, | ||
backgroundColor: "transparent" | ||
// alignItems: "stretch", | ||
// justifyContent: "space-between" | ||
}, | ||
baseText: {}, | ||
backgroundVideo: { | ||
position: "absolute", | ||
top: 0, | ||
left: 0, | ||
bottom: 0, | ||
right: 0, | ||
backgroundColor: "transparent" | ||
} | ||
}); |
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,40 @@ | ||
import React from "react"; | ||
import { StyleSheet, Dimensions, Image } from "react-native"; | ||
import MapView, { Marker, PROVIDER_GOOGLE } from "react-native-maps"; | ||
|
||
const BlueFlagImg = require("../assets/navPage/flag-pink.png"); | ||
const { width, height } = Dimensions.get("window"); | ||
const ASPECT_RATIO = width / height; | ||
|
||
const region = { | ||
latitude: 31.99246, | ||
longitude: 34.76881, | ||
latitudeDelta: 0.01, | ||
longitudeDelta: 0.01 * ASPECT_RATIO | ||
}; | ||
|
||
function CustomMap() { | ||
return ( | ||
<MapView | ||
provider={PROVIDER_GOOGLE} | ||
region={region} | ||
style={{ | ||
...StyleSheet.absoluteFillObject | ||
}} | ||
> | ||
<Marker | ||
coordinate={region} | ||
title="KB-PURE" | ||
description="KB-PURE" | ||
> | ||
<Image | ||
source={BlueFlagImg} | ||
resizeMode="contain" | ||
style={{width: 100, height: 100}} | ||
/> | ||
</Marker> | ||
</MapView> | ||
); | ||
} | ||
|
||
export default CustomMap; |
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,19 @@ | ||
import React from "react"; | ||
import { Text, StyleSheet } from "react-native"; | ||
import { RFPercentage } from "react-native-responsive-fontsize"; | ||
|
||
const KBText = props => ( | ||
<Text adjustsFontSizeToFit {...props} style={[styles.baseText, props.style]}> | ||
{props.children} | ||
</Text> | ||
); | ||
|
||
const styles = StyleSheet.create({ | ||
baseText: { | ||
fontFamily: "heb-open-sans-regular", | ||
fontSize: RFPercentage(2.7), | ||
textAlign: "center" | ||
} | ||
}); | ||
|
||
export default KBText; |
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 React from "react"; | ||
import { StyleSheet } from "react-native"; | ||
import { RFPercentage } from "react-native-responsive-fontsize"; | ||
import KBText from "./KBText"; | ||
|
||
const KBTitle = props => ( | ||
<KBText {...props} style={[styles.baseTitle, props.style]}> | ||
{props.children} | ||
</KBText> | ||
); | ||
|
||
const styles = StyleSheet.create({ | ||
baseTitle: { | ||
fontFamily: "heb-open-sans-bold", | ||
fontSize: RFPercentage(3), | ||
textAlign: "center" | ||
} | ||
}); | ||
|
||
export default KBTitle; |
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,79 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import { Image } from "react-native"; | ||
import { AppLoading } from "expo"; | ||
import { Asset } from "expo-asset"; | ||
import * as Font from "expo-font"; | ||
import { FontAwesome, Ionicons } from "@expo/vector-icons"; | ||
|
||
function cacheAssetsAsync({ images = [], fonts = [] }) { | ||
return Promise.all([...cacheImages(images), ...cacheFonts(fonts)]); | ||
} | ||
|
||
function cacheImages(images) { | ||
return images.map(image => { | ||
if (typeof image === "string") { | ||
return Image.prefetch(image); | ||
} else { | ||
return Asset.fromModule(image).downloadAsync(); | ||
} | ||
}); | ||
} | ||
|
||
function cacheFonts(fonts) { | ||
return fonts.map(font => Font.loadAsync(font)); | ||
} | ||
|
||
function LoadAssets(props) { | ||
const [isReady, setReady] = useState(false); | ||
|
||
useEffect(() => { | ||
async function _cache() { | ||
try { | ||
await cacheAssetsAsync({ | ||
images: [ | ||
require("../assets/images/logo-large.png"), | ||
require("../assets/images/user.png"), | ||
require("../assets/back-blur-3.mp4"), | ||
require("../assets/kb-icon.png"), | ||
require("../assets/hamburger.png"), | ||
require("../assets/navPage/flag-blue.png"), | ||
require("../assets/navPage/flag-pink.png"), | ||
require("../assets/navPage/waze.png"), | ||
], | ||
fonts: [ | ||
FontAwesome.font, | ||
Ionicons.font, | ||
{ | ||
"open-sans-bold": require("../assets/Fonts/OpenSans/English/OpenSans-Bold.ttf"), | ||
"open-sans-regular": require("../assets/Fonts/OpenSans/English/OpenSans-Regular.ttf"), | ||
"open-sans-light": require("../assets/Fonts/OpenSans/English/OpenSans-Light.ttf"), | ||
|
||
"heb-open-sans-bold": require("../assets/Fonts/OpenSans/Hebrew/OpenSansHebrew-Bold.ttf"), | ||
"heb-open-sans-regular": require("../assets/Fonts/OpenSans/Hebrew/OpenSansHebrew-Regular.ttf"), | ||
"heb-open-sans-light": require("../assets/Fonts/OpenSans/Hebrew/OpenSansHebrew-Light.ttf"), | ||
|
||
"heb-condense-open-sans-bold": require("../assets/Fonts/OpenSans/HebrewCondensed/OpenSansHebrewCondensed-Bold.ttf"), | ||
"heb-condense-open-sans-regular": require("../assets/Fonts/OpenSans/HebrewCondensed/OpenSansHebrewCondensed-Regular.ttf"), | ||
"heb-condense-open-sans-light": require("../assets/Fonts/OpenSans/HebrewCondensed/OpenSansHebrewCondensed-Light.ttf"), | ||
} | ||
] | ||
}); | ||
} catch (e) { | ||
console.warn( | ||
"There was an error caching assets (see: main.js), perhaps due to a " + | ||
"network timeout, so we skipped caching. Reload the app to try again." | ||
); | ||
console.log(e.message); | ||
} finally { | ||
setReady(true); | ||
} | ||
} | ||
|
||
_cache() | ||
return () => {}; | ||
}, []); | ||
|
||
return isReady ? props.children : <AppLoading/>; | ||
} | ||
|
||
export default LoadAssets; |
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,24 @@ | ||
import { Image, StyleSheet, TouchableOpacity, Dimensions } from "react-native"; | ||
import React from "react"; | ||
|
||
const Logo = props => ( | ||
<TouchableOpacity style={props.style} onPress={props.onPress}> | ||
<Image | ||
source={require("../assets/images/logo-large.png")} | ||
resizeMode="contain" | ||
style={styles.logo} | ||
/> | ||
</TouchableOpacity> | ||
); | ||
|
||
const deviceWidth = Dimensions.get("window").width; | ||
|
||
const styles = StyleSheet.create({ | ||
logo: { | ||
height: undefined, | ||
width: deviceWidth / 2.8, | ||
aspectRatio: 1, | ||
} | ||
}); | ||
|
||
export default Logo; |
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,14 @@ | ||
import React, { useEffect } from "react"; | ||
|
||
import { useStateValue } from "../Utils/State"; | ||
|
||
function Logout() { | ||
const [state, dispatch] = useStateValue(); | ||
console.log("*** state", state); | ||
console.log("*** dispatch", dispatch); | ||
|
||
useEffect(() => { | ||
}, []); | ||
return null; | ||
} | ||
export default Logout; |
18 changes: 10 additions & 8 deletions
18
components/MaterialButtonDark.js → Components/MaterialButtonDark.tsx
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,13 @@ | ||
import React from 'react'; | ||
import KBTitle from "./KBTitle"; | ||
import {translated} from "../Utils/Localization"; | ||
|
||
function Top10(props) { | ||
return ( | ||
<KBTitle style={{}}> | ||
{translated("PersonalPage.Top10")} | ||
</KBTitle> | ||
) | ||
} | ||
|
||
export default Top10; |
Oops, something went wrong.