mirror of
https://github.com/naturalcrit/homebrewery.git
synced 2025-12-24 12:02:48 +00:00
Help dropdown uses existing dropdown class. Small tweaks.
This commit is contained in:
@@ -4,46 +4,22 @@ const _ = require('lodash');
|
||||
|
||||
const Nav = require('naturalcrit/nav/nav.jsx');
|
||||
|
||||
const Help = createClass({
|
||||
|
||||
getInitialState : function() {
|
||||
return {
|
||||
showDropdown : false
|
||||
};
|
||||
},
|
||||
|
||||
handleDropdown : function(show){
|
||||
this.setState({
|
||||
showDropdown : show
|
||||
});
|
||||
},
|
||||
|
||||
renderDropdown : function(){
|
||||
return !this.state.showDropdown ? null : <div className='dropdown'>
|
||||
<a href={`https://www.reddit.com/r/homebrewery/submit?selftext=true&title=${encodeURIComponent('[Issue] Describe Your Issue Here')}`}
|
||||
className='item red'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'>
|
||||
<span className='title'>report issue <i className='fas fa-fw fa-bug'/></span>
|
||||
</a>
|
||||
<a href='/migrate'
|
||||
className='item blue'
|
||||
target='_blank'
|
||||
rel='noopener noreferrer'>
|
||||
<span className='title'>migrate <i className='fas fa-fw fa-route'/></span>
|
||||
</a>
|
||||
</div>;
|
||||
},
|
||||
|
||||
render : function(){
|
||||
return <Nav.item icon='fas fa-life-ring' color='grey' className='recent'
|
||||
onMouseEnter={()=>this.handleDropdown(true)}
|
||||
onMouseLeave={()=>this.handleDropdown(false)}>
|
||||
Need Help?
|
||||
{this.renderDropdown()}
|
||||
</Nav.item>;
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
module.exports = Help;
|
||||
module.exports = function(props){
|
||||
return <Nav.dropdown>
|
||||
<Nav.item color='grey' icon='fas fa-question-circle'>
|
||||
need help?
|
||||
</Nav.item>
|
||||
<Nav.item color='red' icon='fas fa-fw fa-bug'
|
||||
href={`https://www.reddit.com/r/homebrewery/submit?selftext=true&title=${encodeURIComponent('[Issue] Describe Your Issue Here')}`}
|
||||
newTab={true}
|
||||
rel='noopener noreferrer'>
|
||||
report issue
|
||||
</Nav.item>
|
||||
<Nav.item color='blue' icon='fas fa-fw fa-file-import'
|
||||
href='/migrate'
|
||||
newTab={true}
|
||||
rel='noopener noreferrer'>
|
||||
migrate
|
||||
</Nav.item>
|
||||
</Nav.dropdown>;
|
||||
};
|
||||
|
||||
@@ -68,8 +68,7 @@
|
||||
color: pink;
|
||||
}
|
||||
}
|
||||
.recent.navItem,
|
||||
.help.navItem{
|
||||
.recent.navItem {
|
||||
position : relative;
|
||||
.dropdown{
|
||||
position : absolute;
|
||||
@@ -97,7 +96,7 @@
|
||||
position : relative;
|
||||
display : block;
|
||||
box-sizing : border-box;
|
||||
padding : 13px 5px;
|
||||
padding : 8px 5px 13px;
|
||||
background-color : #333;
|
||||
color : white;
|
||||
text-decoration : none;
|
||||
@@ -106,14 +105,11 @@
|
||||
background-color : @blue;
|
||||
}
|
||||
.title{
|
||||
display : inline-block;
|
||||
overflow : hidden;
|
||||
width : 100%;
|
||||
text-overflow : ellipsis;
|
||||
white-space : nowrap;
|
||||
|
||||
i{
|
||||
float: right;
|
||||
}
|
||||
}
|
||||
.time{
|
||||
position : absolute;
|
||||
|
||||
@@ -60,9 +60,11 @@ nav{
|
||||
color : white;
|
||||
text-decoration : none;
|
||||
text-transform : uppercase;
|
||||
line-height : 13px;
|
||||
i{
|
||||
margin-left : 5px;
|
||||
font-size : 13px;
|
||||
float : right;
|
||||
}
|
||||
}
|
||||
.navSection:last-child .navItem{
|
||||
|
||||
Reference in New Issue
Block a user