Skip to content

Commit fcdcde9

Browse files
committed
Remove <page>
1 parent 8deab25 commit fcdcde9

File tree

1 file changed

+39
-41
lines changed

1 file changed

+39
-41
lines changed

demo-react/src/components/HomeScreen.tsx

Lines changed: 39 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -5,48 +5,46 @@ export function ExampleTabs() {
55
const [selectedIndex, setSelectedIndex] = React.useState(0);
66

77
return (
8-
<page style={{ backgroundColor: 'yellow' }}>
9-
<tabs
10-
selectedIndex={selectedIndex}
11-
onSelectedIndexChanged={(args) => {
12-
setSelectedIndex(args.newIndex);
13-
}}
14-
style={{ ...styles.fullSize, backgroundColor: 'orange' }}
15-
>
16-
{/* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */}
17-
<tabStrip nodeRole="tabStrip" style={{ backgroundColor: 'red' }}>
18-
<tabStripItem nodeRole="items">
19-
<label nodeRole="label">Home</label>
20-
<image nodeRole="image" src="font://&#xf015;" className="fas" />
21-
</tabStripItem>
22-
<tabStripItem nodeRole="items" className="special">
23-
<label nodeRole="label">Account</label>
24-
<image nodeRole="image" src="font://&#xf007;" className="fas" />
25-
</tabStripItem>
26-
<tabStripItem nodeRole="items" className="special">
27-
<label nodeRole="label">Search</label>
28-
<image nodeRole="image" src="font://&#xf00e;" className="fas" />
29-
</tabStripItem>
30-
</tabStrip>
8+
<tabs
9+
selectedIndex={selectedIndex}
10+
onSelectedIndexChanged={(args) => {
11+
setSelectedIndex(args.newIndex);
12+
}}
13+
style={{ ...styles.fullSize, backgroundColor: 'orange' }}
14+
>
15+
{/* The bottomTab UI is created via tabStrip (the container) and tabStripItem (for each tab) */}
16+
<tabStrip nodeRole="tabStrip" style={{ backgroundColor: 'red' }}>
17+
<tabStripItem nodeRole="items">
18+
<label nodeRole="label">Home</label>
19+
<image nodeRole="image" src="font://&#xf015;" className="fas" />
20+
</tabStripItem>
21+
<tabStripItem nodeRole="items" className="special">
22+
<label nodeRole="label">Account</label>
23+
<image nodeRole="image" src="font://&#xf007;" className="fas" />
24+
</tabStripItem>
25+
<tabStripItem nodeRole="items" className="special">
26+
<label nodeRole="label">Search</label>
27+
<image nodeRole="image" src="font://&#xf00e;" className="fas" />
28+
</tabStripItem>
29+
</tabStrip>
3130

32-
{/* The number of tabContentItem components should corespond to the number of TabStripItem components */}
33-
<tabContentItem nodeRole="items">
34-
<gridLayout style={{ ...styles.fullSize, backgroundColor: 'blue' }}>
35-
<label style={{ color: 'white' }}>Home Page</label>
36-
</gridLayout>
37-
</tabContentItem>
38-
<tabContentItem nodeRole="items">
39-
<gridLayout style={{ ...styles.fullSize, backgroundColor: 'cyan' }}>
40-
<label style={{ color: 'black' }}>Account Page</label>
41-
</gridLayout>
42-
</tabContentItem>
43-
<tabContentItem nodeRole="items">
44-
<gridLayout style={{ ...styles.fullSize, backgroundColor: 'magenta' }}>
45-
<label style={{ color: 'black' }}>Search Page</label>
46-
</gridLayout>
47-
</tabContentItem>
48-
</tabs>
49-
</page>
31+
{/* The number of tabContentItem components should corespond to the number of TabStripItem components */}
32+
<tabContentItem nodeRole="items">
33+
<gridLayout style={{ ...styles.fullSize, backgroundColor: 'blue' }}>
34+
<label style={{ color: 'white' }}>Home Page</label>
35+
</gridLayout>
36+
</tabContentItem>
37+
<tabContentItem nodeRole="items">
38+
<gridLayout style={{ ...styles.fullSize, backgroundColor: 'cyan' }}>
39+
<label style={{ color: 'black' }}>Account Page</label>
40+
</gridLayout>
41+
</tabContentItem>
42+
<tabContentItem nodeRole="items">
43+
<gridLayout style={{ ...styles.fullSize, backgroundColor: 'magenta' }}>
44+
<label style={{ color: 'black' }}>Search Page</label>
45+
</gridLayout>
46+
</tabContentItem>
47+
</tabs>
5048
);
5149
}
5250

0 commit comments

Comments
 (0)