1
+ import Header from '../Header' ;
2
+
1
3
import RangeInputFixtures from './range-inputs' ;
2
4
import TextInputFixtures from './text-inputs' ;
3
5
import SelectFixtures from './selects' ;
@@ -11,44 +13,43 @@ import ErrorHandling from './error-handling';
11
13
import EventPooling from './event-pooling' ;
12
14
import CustomElementFixtures from './custom-elements' ;
13
15
import MediaEventsFixtures from './media-events' ;
16
+ import {
17
+ SelectionEventFixtureRoot ,
18
+ SelectionEventFixtureIFrame ,
19
+ } from './selection-events' ;
14
20
15
21
const React = window . React ;
16
22
17
- /**
18
- * A simple routing component that renders the appropriate
19
- * fixture based on the location pathname.
20
- */
23
+ const RouteConfig = {
24
+ '/text-inputs' : < TextInputFixtures /> ,
25
+ '/range-inputs' : < RangeInputFixtures /> ,
26
+ '/selects' : < SelectFixtures /> ,
27
+ '/textareas' : < TextAreaFixtures /> ,
28
+ '/input-change-events' : < InputChangeEvents /> ,
29
+ '/number-inputs' : < NumberInputFixtures /> ,
30
+ '/password-inputs' : < PasswordInputFixtures /> ,
31
+ '/buttons' : < ButtonFixtures /> ,
32
+ '/date-inputs' : < DateInputFixtures /> ,
33
+ '/error-handling' : < ErrorHandling /> ,
34
+ '/event-pooling' : < EventPooling /> ,
35
+ '/custom-elements' : < CustomElementFixtures /> ,
36
+ '/media-events' : < MediaEventsFixtures /> ,
37
+ '/selection-events' : < SelectionEventFixtureRoot /> ,
38
+ } ;
39
+
21
40
function FixturesPage ( ) {
22
- switch ( window . location . pathname ) {
23
- case '/text-inputs' :
24
- return < TextInputFixtures /> ;
25
- case '/range-inputs' :
26
- return < RangeInputFixtures /> ;
27
- case '/selects' :
28
- return < SelectFixtures /> ;
29
- case '/textareas' :
30
- return < TextAreaFixtures /> ;
31
- case '/input-change-events' :
32
- return < InputChangeEvents /> ;
33
- case '/number-inputs' :
34
- return < NumberInputFixtures /> ;
35
- case '/password-inputs' :
36
- return < PasswordInputFixtures /> ;
37
- case '/buttons' :
38
- return < ButtonFixtures /> ;
39
- case '/date-inputs' :
40
- return < DateInputFixtures /> ;
41
- case '/error-handling' :
42
- return < ErrorHandling /> ;
43
- case '/event-pooling' :
44
- return < EventPooling /> ;
45
- case '/custom-elements' :
46
- return < CustomElementFixtures /> ;
47
- case '/media-events' :
48
- return < MediaEventsFixtures /> ;
49
- default :
50
- return < p > Please select a test fixture.</ p > ;
41
+ const { pathname} = window . location ;
42
+ if ( pathname === '/selection-events-iframe' ) {
43
+ return < SelectionEventFixtureIFrame /> ;
51
44
}
45
+ return (
46
+ < div >
47
+ < Header />
48
+ < div className = "container" >
49
+ { RouteConfig [ pathname ] || < p > Please select a test fixture.</ p > }
50
+ </ div >
51
+ </ div >
52
+ ) ;
52
53
}
53
54
54
55
export default FixturesPage ;
0 commit comments