Skip to content

Commit

Permalink
Merge pull request #26 from jaydenchee97/feature
Browse files Browse the repository at this point in the history
update webview and mobile view
  • Loading branch information
jaydenchee97 authored Aug 25, 2024
2 parents 79ffb3c + df27271 commit d1fc3a2
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions src/navigation/AppStack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@ import { createStackNavigator } from '@react-navigation/stack';
import { useEffect, useState } from 'react';
import { Auth } from 'aws-amplify';
import HomeStack from './HomeStack';
import { Dimensions, StyleSheet } from "react-native";
import { useTheme } from 'react-native-paper';



const Stack = createStackNavigator();

export default function AppStack() {
const [isAuthenticated, setIsAuthenticated] = useState<boolean | null>(null);
const { width, height } = Dimensions.get('window');
const aspectRatio = height / width;

const isTabletOrWebView = aspectRatio < 1.6; // Assumes 4:3 aspect ratio for tablets

const theme = useTheme(); // Move useTheme inside the component

const styles = StyleSheet.create({
webViewStyles: {
backgroundColor: theme.colors.background,
paddingHorizontal: "20%"
},
phoneViewStyles: {
backgroundColor: theme.colors.background
}
});


const handleAuth = async () => {
try {

Expand All @@ -28,12 +49,13 @@ export default function AppStack() {
}

return (
<Stack.Navigator>
<Stack.Navigator screenOptions={{cardStyle: isTabletOrWebView ? styles.webViewStyles : styles.phoneViewStyles}}>
<Stack.Screen
name="HomeStack"
component={HomeStack}
options={{ headerShown: false }}
options={{ headerShown: false, }}
/>
</Stack.Navigator>
);
}

0 comments on commit d1fc3a2

Please sign in to comment.