Improved homepage

This commit is contained in:
Keannu Bernasol 2023-07-07 15:07:56 +08:00
parent d9adc45b27
commit 875a7154fa
2 changed files with 7 additions and 3 deletions

View file

@ -48,6 +48,7 @@ export default function Home() {
function CustomMap() { function CustomMap() {
if (dist !== null && location !== null) { if (dist !== null && location !== null) {
if (dist <= 1) { if (dist <= 1) {
// Just switch this condition for map debugging
return <MapView style={styles.map} initialRegion={ustpCoords} />; return <MapView style={styles.map} initialRegion={ustpCoords} />;
} else { } else {
return ( return (
@ -77,7 +78,6 @@ export default function Home() {
return ( return (
<View style={styles.background}> <View style={styles.background}>
<AnimatedContainer> <AnimatedContainer>
<Text style={styles.text_white_large}>Template Homepage</Text>
<CustomMap /> <CustomMap />
</AnimatedContainer> </AnimatedContainer>
</View> </View>

View file

@ -3,6 +3,9 @@ import { StyleSheet, Dimensions } from "react-native";
const width = Dimensions.get("window").width; const width = Dimensions.get("window").width;
const height = Dimensions.get("window").height; const height = Dimensions.get("window").height;
const containerWidth = width - width * 0.08;
const containerHeight = height - height * 0.01;
export const colors = { export const colors = {
orange_1: "#FFBC72", orange_1: "#FFBC72",
orange_2: "#FFE2C1", orange_2: "#FFE2C1",
@ -109,8 +112,9 @@ const styles = StyleSheet.create({
marginVertical: 6, marginVertical: 6,
}, },
map: { map: {
height: 512, flex: 1,
width: "90%", height: containerHeight,
width: containerWidth,
alignSelf: "center", alignSelf: "center",
}, },
}); });