File tree 5 files changed +42
-15
lines changed
5 files changed +42
-15
lines changed Original file line number Diff line number Diff line change @@ -55,14 +55,35 @@ class App extends Component {
55
55
return null ;
56
56
}
57
57
58
+ // First problem: Text style hierarchy doesn't work (it should render in orange)
59
+ // Second problem: View positions aren't correctly geometrically
60
+ // Third problem: View backgroundColor isn't correct, 2nd View should have same bgc as 1st
61
+ // and also 4th should have same as 3rd
58
62
return (
59
- < View style = { styles . surface } >
60
- < Clock />
61
- < Sidebar />
62
- < Slideshow />
63
- < Grid />
63
+ < View style = { { width : 80 , height : 80 , backgroundColor : 'grey' , color : 'orange' } } >
64
+ < View >
65
+ < View style = { { width : 80 , height : 80 , backgroundColor : 'powderblue' } } >
66
+ < View
67
+ style = { {
68
+ width : 30 ,
69
+ height : 30
70
+ } }
71
+ >
72
+ < Text > should be in orange</ Text >
73
+ </ View >
74
+ </ View >
75
+ </ View >
64
76
</ View >
65
77
) ;
78
+
79
+ // return (
80
+ // <View style={styles.surface}>
81
+ // <Clock />
82
+ // <Sidebar />
83
+ // <Slideshow />
84
+ // <Grid />
85
+ // </View>
86
+ // );
66
87
}
67
88
}
68
89
Original file line number Diff line number Diff line change @@ -63,8 +63,11 @@ class Sidebar extends Component {
63
63
text = "Rio de Janeiro"
64
64
idx = { 120 }
65
65
/>
66
- < FocusableItem focusKey = "sidebar-item-2" text = "Kyoto " idx = { 160 } />
66
+ < FocusableItem focusKey = "sidebar-item-2" text = "京都 " idx = { 160 } />
67
67
< FocusableItem focusKey = "sidebar-item-3" text = "Stockholm" idx = { 200 } />
68
+ < FocusableItem focusKey = "sidebar-item-4" text = "Phoenix" idx = { 240 } />
69
+ < FocusableItem focusKey = "sidebar-item-5" text = "नई दिल्ली" idx = { 280 } />
70
+ < FocusableItem focusKey = "sidebar-item-6" text = "Cusco" idx = { 320 } />
68
71
{ /*</View>*/ }
69
72
</ View >
70
73
) ;
Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import {render, View} from '../reactApeEntry';
3
3
import testCanvasSnapshot from '../../../tests/testCanvasSnapshot' ;
4
4
5
5
describe ( 'Layout test' , ( ) => {
6
- describe ( 'Test "relative" and "absolute" < Views/> ' , ( ) => {
6
+ describe ( 'Test "relative" and "absolute" Views' , ( ) => {
7
7
test ( 'Test 5 views with different positions (4 relative and 1 absolute)' , ( ) => {
8
8
const canvas = document . createElement ( 'canvas' ) ;
9
9
canvas . height = 600 ;
@@ -68,6 +68,8 @@ describe('Layout test', () => {
68
68
69
69
render ( < Layout /> , canvas , ( ) => testCanvasSnapshot ( expect , canvas ) ) ;
70
70
} ) ;
71
+ } ) ;
72
+ describe ( 'BorderRadius' , ( ) => {
71
73
test ( 'Test 2 View with BorderRadius' , ( ) => {
72
74
const canvas = document . createElement ( 'canvas' ) ;
73
75
canvas . height = 600 ;
Original file line number Diff line number Diff line change @@ -23,17 +23,16 @@ function renderApeQueue(
23
23
) {
24
24
if ( apeContextGlobal && apeContextGlobal . renderQueue . length ) {
25
25
const queue = apeContextGlobal . renderQueue ;
26
- let req ;
27
26
27
+ let reqId ;
28
28
const frame = ( ) => {
29
- req = requestAnimationFrame ( frame ) ;
30
- const element = queue . shift ( ) ;
31
- element . render ( apeContextGlobal , element . parentLayout ) ;
29
+ if ( queue . length ) {
30
+ const element = queue . shift ( ) ;
31
+ element . render ( apeContextGlobal , element . parentLayout ) ;
32
32
33
- requestAnimationFrame ( frame ) ;
34
-
35
- if ( ! queue . length ) {
36
- cancelAnimationFrame ( req ) ;
33
+ reqId = requestAnimationFrame ( frame ) ;
34
+ } else {
35
+ cancelAnimationFrame ( reqId ) ;
37
36
onFinish ( ) ;
38
37
}
39
38
} ;
Original file line number Diff line number Diff line change @@ -6,6 +6,8 @@ const jsdom = new JSDOM('<!doctype html><html><body></body></html>', {
6
6
url : 'http://localhost/' ,
7
7
} ) ;
8
8
const { window } = jsdom ;
9
+ window . requestAnimationFrame = ( cb ) => window . setTimeout ( cb , 1000 / 60 ) ;
10
+ window . cancelAnimationFrame = ( ) => null ;
9
11
10
12
function copyProps ( src , target ) {
11
13
const props = Object . getOwnPropertyNames ( src )
You can’t perform that action at this time.
0 commit comments