-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathBasic.js
77 lines (67 loc) · 1.72 KB
/
Basic.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
var React = require("react");
var BasicModifier = require("./BasicModifier");
var BasicModifier2 = require("./BasicModifier2");
var TextComponent = require("./TextComponent");
var Style = require("../react-inline-style");
///////////////////////////////////////////////////////////////////////////////
Style.debug=true;
Style = Style.define({
root : {
cursor:"pointer",
title : {
fontFamily : "Arial, sans-serif",
fontWeight : "bold",
color:"grey"
}
},
standardFont: {
fontSize:"16px",
fontFamily:"Arial, sans-serif"
},
textComponent: {
textDecoration:"underline",
textAlign : "right"
},
special : {
textComponent: {
color:"purple",
fontSize:"24px",
fontWeight:"bold"
}
}
});
///////////////////////////////////////////////////////////////////////////////
module.exports = React.createClass({
mixins : [Style()],
click : click,
render : render
});
///////////////////////////////////////////////////////////////////////////////
///////////////////////////////////////////////////////////////////////////////
function click(){
this.style.define({
textComponent : {
backgroundColor: "lightgrey",
color: "yellow"
},
root: {
clicked : {
color:"orange",
textDecoration : "underline"
}
}
});
this.forceUpdate();
}
///////////////////////////////////////////////////////////////////////////////
function render(){
return (
<div style={this.style("root")} onClick={this.click}>
<p style={this.style("root.title", "root.clicked:pressed")}>Basic:</p>
<TextComponent />
<BasicModifier />
<BasicModifier2 />
<TextComponent cssNamespace="special" />
</div>
);
}