| 123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107 |
- import { useRouter } from 'expo-router';
- import {
- View,
- Text,
- Image,
- StyleSheet,
- TouchableOpacity,
- Dimensions,
- } from 'react-native';
- import AsyncStorage from '@react-native-async-storage/async-storage';
- import { useEffect } from 'react';
- const { width, height } = Dimensions.get('window');
- export default function IntroScreen() {
- const router = useRouter();
- useEffect(() => {
- const checkGuest = async () => {
- const isGuest = await AsyncStorage.getItem('isGuest');
- router.replace('/main');
- // TODO: Google Login 기능 구현시
- // if (isGuest === 'true') {
- // router.replace('/main');
- // }
- };
-
- checkGuest();
- }, []);
- const handleGuestStart = async () => {
- await AsyncStorage.setItem('isGuest', 'true');
- router.replace('/main');
- };
- const handleLoginPress = () => {
- // 추후 개발: 로그인 페이지로 이동
- alert('로그인 기능은 추후 지원 예정입니다.');
- };
- return (
- <View style={styles.container}>
- <Image
- source={require('../assets/background.png')}
- style={styles.backgroundImage}
- resizeMode="cover"
- />
- <View style={styles.overlay}>
- <TouchableOpacity style={styles.button} onPress={handleGuestStart}>
- <Text style={styles.buttonText}>게스트로 시작하기</Text>
- </TouchableOpacity>
-
- {/* TODO: Google 로그인 추후 구현 */}
- {/*<TouchableOpacity style={styles.buttonOutline} onPress={handleLoginPress}>*/}
- {/* <Text style={styles.buttonOutlineText}>Gmail로 로그인</Text>*/}
- {/*</TouchableOpacity>*/}
- </View>
- </View>
- );
- }
- const styles = StyleSheet.create({
- container: {
- flex: 1,
- },
- backgroundImage: {
- width,
- height,
- position: 'absolute',
- },
- overlay: {
- flex: 1,
- justifyContent: 'center',
- alignItems: 'center',
- paddingHorizontal: 32,
- backgroundColor: 'rgba(0, 0, 0, 0.4)',
- },
- button: {
- backgroundColor: '#FF6B00',
- paddingVertical: 14,
- paddingHorizontal: 36,
- borderRadius: 12,
- marginBottom: 16,
- width: '100%',
- alignItems: 'center',
- },
- buttonText: {
- color: '#FFF',
- fontSize: 16,
- fontWeight: 'bold',
- },
- buttonOutline: {
- borderWidth: 2,
- borderColor: '#FFF',
- paddingVertical: 14,
- paddingHorizontal: 36,
- borderRadius: 12,
- width: '100%',
- alignItems: 'center',
- },
- buttonOutlineText: {
- color: '#FFF',
- fontSize: 16,
- fontWeight: 'bold',
- },
- });
|