|
|
@@ -1,25 +1,26 @@
|
|
|
import React, { useState } from 'react';
|
|
|
-import { View, Text, SafeAreaView, StyleSheet } from 'react-native';
|
|
|
-import SearchScreen from '@/app/seach.tsx';
|
|
|
+import { View, StyleSheet, SafeAreaView } from 'react-native';
|
|
|
+import SearchScreen from '@/app/seach';
|
|
|
import BottomTabBar from '@/components/BottomTabBar';
|
|
|
+import FavoritesScreen from "@/app/favorites";
|
|
|
+import MyInfoScreen from "@/app/myInfo";
|
|
|
|
|
|
export default function MainScreen() {
|
|
|
const [tab, setTab] = useState<'search' | 'favorites' | 'settings'>('search');
|
|
|
|
|
|
- const renderContent = () => {
|
|
|
- switch (tab) {
|
|
|
- case 'search':
|
|
|
- return <SearchScreen />;
|
|
|
- case 'favorites':
|
|
|
- return <Text>⭐ 즐겨찾기 화면</Text>;
|
|
|
- case 'settings':
|
|
|
- return <Text>👤 내 설정 화면</Text>;
|
|
|
- }
|
|
|
- };
|
|
|
-
|
|
|
return (
|
|
|
<SafeAreaView style={styles.container}>
|
|
|
- <View style={styles.content}>{renderContent()}</View>
|
|
|
+ <View style={styles.content}>
|
|
|
+ <View style={[styles.screen, tab !== 'search' && styles.hidden]}>
|
|
|
+ <SearchScreen />
|
|
|
+ </View>
|
|
|
+ <View style={[styles.screen, tab !== 'favorites' && styles.hidden]}>
|
|
|
+ <FavoritesScreen />
|
|
|
+ </View>
|
|
|
+ <View style={[styles.screen, tab !== 'settings' && styles.hidden]}>
|
|
|
+ <MyInfoScreen />
|
|
|
+ </View>
|
|
|
+ </View>
|
|
|
<BottomTabBar activeTab={tab} onTabChange={setTab} />
|
|
|
</SafeAreaView>
|
|
|
);
|
|
|
@@ -32,7 +33,11 @@ const styles = StyleSheet.create({
|
|
|
},
|
|
|
content: {
|
|
|
flex: 1,
|
|
|
- justifyContent: 'center',
|
|
|
- alignItems: 'center',
|
|
|
+ },
|
|
|
+ screen: {
|
|
|
+ ...StyleSheet.absoluteFillObject,
|
|
|
+ },
|
|
|
+ hidden: {
|
|
|
+ display: 'none',
|
|
|
},
|
|
|
});
|