Skip to content

Commit fbf16d4

Browse files
committed
Add TextButton
1 parent 77e1356 commit fbf16d4

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

src/firefly/js/ui/TextButton.css

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
.ff-MenuItem-linkButton {
3+
padding: 5px;
4+
-moz-border-radius: 0 0 5px 5px;
5+
-webkit-border-radius: 0 0 5px 5px;
6+
border-radius: 0 0 5px 5px;
7+
background-color: rgba(245,245,245,.97);
8+
-webkit-box-shadow: 0px 5px 10px rgba(0,0,0,0.3);
9+
-moz-box-shadow: 0px 5px 10px rgba(0,0,0,0.3);
10+
box-shadow: 0px 5px 10px rgba(0,0,0,0.3);
11+
}
12+
13+
.ff-MenuItem-linkButton .menuItemText {
14+
font-size: 10pt;
15+
line-height: 14pt;
16+
}
17+
18+
.ff-MenuItem-linkButton .menuItemText:HOVER {
19+
background-color: rgba(255,255,255,.97);
20+
}

src/firefly/js/ui/TextButton.jsx

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
/*
2+
* License information at https://github.com/Caltech-IPAC/firefly/blob/master/License.txt
3+
*/
4+
5+
6+
import React, {Component, PropTypes} from 'react';
7+
import './TextButton.css';
8+
9+
const labelStyle= {
10+
display: 'inline-block',
11+
lineHeight: '30px',
12+
fontSize: '10pt',
13+
color: 'black',
14+
verticalAlign:'baseline'
15+
};
16+
17+
const messageStyle={
18+
fontSize: '10pt',
19+
lineHeight: '14pt'
20+
};
21+
22+
/**
23+
*
24+
* @param text
25+
* @param tip
26+
* @param onClick
27+
* @param style
28+
* @return react object
29+
*/
30+
export function TextButton({text, tip='$text',style={}, onClick}) {
31+
var s= Object.assign({cursor:'pointer', verticalAlign:'bottom'},style);
32+
return (
33+
<div style={s} title={tip} onClick={onClick}>
34+
35+
<div style={labelStyle} title={tip}>
36+
<u>{text}</u>
37+
</div>
38+
39+
</div>
40+
);
41+
}
42+
43+
44+
//CloseButton.contextTypes= {
45+
//};
46+
47+
48+
TextButton.propTypes= {
49+
text : PropTypes.string,
50+
style : PropTypes.object,
51+
tip : PropTypes.string,
52+
onClick : PropTypes.func
53+
};
54+
55+
56+

0 commit comments

Comments
 (0)