File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -22,23 +22,26 @@ const styles = StyleSheet.create({
2222 container : {
2323 position : 'absolute' ,
2424 left : 40 ,
25- top : 100 ,
25+ // top: 100,
2626 borderRadius : 10 ,
2727 lineHeight : 40 ,
28+ backgroundColor : 'orange'
2829 } ,
2930} ) ;
3031
3132class Item extends React . Component {
3233 render ( ) {
33- const { focused, text, setFocus } = this . props ;
34+ const { focused, idx , text, setFocus } = this . props ;
3435 console . log ( 'focusableitem' , setFocus , focused ) ;
3536 return (
36- < Text style = { {
37- color : focused ? '#331A00' : 'white' ,
38- fontSize : 24
39- } } >
40- { text }
41- </ Text >
37+ < View style = { { ...styles . container , top : idx } } >
38+ < Text style = { {
39+ color : focused ? '#331A00' : 'white' ,
40+ fontSize : 24
41+ } } >
42+ { text }
43+ </ Text >
44+ </ View >
4245 ) ;
4346 }
4447}
@@ -53,20 +56,23 @@ class Sidebar extends Component {
5356 render ( ) {
5457 return (
5558 < View style = { styles . sidebar } >
56- < View style = { styles . container } >
59+ { /* <View style={styles.container}>*/ }
5760 < FocusableItem
5861 focusKey = "sidebar-item-1"
5962 text = "Rio de Janeiro"
63+ idx = { 120 }
6064 />
6165 < FocusableItem
6266 focusKey = "sidebar-item-2"
6367 text = "Kyoto"
68+ idx = { 160 }
6469 />
6570 < FocusableItem
6671 focusKey = "sidebar-item-3"
6772 text = "Stockholm"
73+ idx = { 200 }
6874 />
69- </ View >
75+ { /* </View>*/ }
7076 </ View >
7177 ) ;
7278 }
You can’t perform that action at this time.
0 commit comments