자유해결사 6 lat temu
rodzic
commit
7f4bdc43eb

+ 1 - 1
src/components/TabBar.js

@@ -37,7 +37,7 @@ export default (props)=>{
     }
     
     return (
-        <C.View cls="flx0.1 bgc-color-white flx-row ai-e jc-sa">
+        <C.View cls="h8 bgc-color-white flx-row ai-e jc-sa">
             {
                 Object.keys(btns).map((obj, idx) => { 
                     return ( 

+ 0 - 31
src/navigation/TabNavigator.js

@@ -1,31 +0,0 @@
-
-import React from 'react';
-import { Text, View } from 'react-native';
-import { createBottomTabNavigator, createAppContainer } from 'react-navigation';
-import List from "../pages/_7_List"; 
-class HomeScreen extends React.Component {
-  render() {
-    return (
-      <View style={{ flex: 0.1, justifyContent: 'center', alignItems: 'center' }}>
-        <Text>Home!</Text>
-      </View>
-    );
-  }
-}
-
-class SettingsScreen extends React.Component {
-  render() {
-    return (
-      <View style={{ flex: 0.2, justifyContent: 'center', alignItems: 'center' }}>
-        <Text>Settings!</Text>
-      </View>
-    );
-  }
-}
-
-const TabNavigator = createBottomTabNavigator({
-    List:  List,
-    // Settings: SettingsScreen,
-});
-
-export default createAppContainer(TabNavigator);

+ 8 - 4
src/pages/_5_Root.js

@@ -30,13 +30,17 @@ export default (props)=>{
     let [ sel_idx, setsel_Idx ] =  useState(0);
     let [ targetIdx, setTargetIdx ] =  useState(0);
     
-    let [ bPlay, setbPlay] =  useState(true);
+    let [ bPlay, setbPlay] =  useState(false); 
     let [ curPlayInfo, setCurPlayInfo] =  useState({});
 
     let onTabPress = (tIdx, i)=>{
         setsel_Idx(i);
         setTargetIdx(tIdx);
     }
+    let startPlay = (p)=>{
+        setbPlay(true);
+        setCurPlayInfo(p.Pages);
+    }
     let Page;
     if(sel_idx == -1){
         Page = Main;
@@ -44,18 +48,18 @@ export default (props)=>{
         Page = List; 
     }
     // Page = List;   
-    curPlayInfo = BTNS[targetIdx][sel_idx];
     
 
+    
 
 
 
     return (
         <C.View cls="flx1 bgc-color-white"> 
             <C.Comp.Header  {...props}/>
-            <Page   {...props} Pages={sel_idx == -1 ? {} : BTNS[targetIdx][sel_idx]} />
+            <Page   {...props} Pages={sel_idx == -1 ? {} : BTNS[targetIdx][sel_idx]}  startPlay={startPlay}/>
             
-            {bPlay ? <Player  {...props} Pages={curPlayInfo}  />  : null} 
+            {bPlay ? <Player  {...props} Pages={curPlayInfo}  closePlayer={()=>setbPlay(false)}/>  : null}  
             
             <TabBar onTabPress={onTabPress} BTNS={BTNS}/>  
         </C.View> 

+ 1 - 1
src/pages/_6_Main.js

@@ -1,5 +1,5 @@
 import React from 'react';
-import Tab from '../navigation/TabNavigator';
+
 import C from 'rn-class'
 C.addColor("#d7d7d7", "color-listbg");
 

+ 2 - 1
src/pages/_7_List.js

@@ -7,7 +7,8 @@ C.addColor("#d7d7d7", "color-listbg");
 
 export default (props)=>{ 
     let onClickPlay = (p)=>{ 
-        props.navigation.push('Player');
+        // props.navigation.push('Player');
+        props.startPlay(props);
     }
 
     return (

+ 17 - 6
src/pages/_8_Player.js

@@ -5,14 +5,24 @@ import React  ,{useState}  from 'react';
 
 export default (props)=>{ 
     // console.log(props);
+    
     let [ curPlayIdx, setCurPlayIdx ] =  useState(0);
+    let [ bFull, setbFull ] =  useState(false);
     // po-fulla 
+    let onFull = () =>{
+        setbFull(!bFull);
+    }
+    
     return (
-        <C.View cls="flx0.1 bgc-color-white ai-c zidx2"> 
-            <C.View cls="w90% flx1 bgc-color-listbg br10 flx-row jc-sa ai-c">        
-                <C.Image source={props.Pages.img} 
-                    resizeMode="contain"
-                    cls="flx0.2 h90%" />
+        <C.View cls={`bgc-color-white ai-c zidx2 ${bFull ? "po-fulla" : "flx0.1" }`}> 
+            <C.View cls="w90% flx1 bgc-color-listbg br10 flx-row jc-sa ai-c mt0.4 pt0.4">       
+
+                <C.TouchableOpacity cls="flx0.2 h90%" onPress={onFull}>
+                    <C.Image source={props.Pages.img} 
+                        resizeMode="contain"
+                        cls={"w100% h100%"}
+                         />
+                </C.TouchableOpacity> 
 
                 <C.View cls="flx0.5">
                     <C.Text>제목</C.Text> 
@@ -22,8 +32,9 @@ export default (props)=>{
                         />   
                         
                 </C.View> 
-                <C.View cls="flx0.2 jc-c ai-c">
+                <C.View cls="flx0.2 jc-c ai-sa flx-row">
                     <C.EL.Icon type="entypo" name="controller-play"  /> 
+                    <C.EL.Icon type="entypo" name="cross"  onPress={props.closePlayer}/>  
                 </C.View>
 
             </C.View>