Last active
August 29, 2015 14:04
-
-
Save andreisebastianc/55318ca04bbac8189dbb to your computer and use it in GitHub Desktop.
Dropdown menu approach for reatcjs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** @jsx React.DOM */ | |
define([ | |
'react', | |
'components/common/menu', | |
'components/common/dropdown-menu', | |
'components/user/profile-pic' | |
], function(React, Menu, Dropdown, ProfilePic) { | |
"use strict"; | |
var Header = React.createClass({ | |
render: function() { | |
return ( | |
<div> | |
<Dropdown options={[ | |
{ | |
name: "Something", | |
title: "Something", | |
url: "#something" | |
}, | |
{ | |
name: "Something else", | |
title: "Something else from the application", | |
url: "#something" | |
} | |
]}> | |
<ProfilePic url={'http://graph.facebook.com/' + this.props.data.username + '/picture'} /> | |
<span className="wrapper"> | |
{this.props.data.username} | |
</span> | |
</Dropdown> | |
</div> | |
) | |
} | |
}); | |
return Header; | |
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
.app.menu{ | |
float: right; | |
.dropdown{ | |
@include inline; | |
button{ | |
@include app-menu-action; | |
border: none; | |
background: none; | |
outline: none; | |
padding: 0; | |
.wrapper{ | |
padding: 0 0.625em; | |
} | |
} | |
img{ | |
height: 2.1875em; | |
vertical-align: middle; | |
} | |
a{ | |
display: block; | |
line-height: 2.5em; | |
text-align: center; | |
} | |
ul{ | |
background: #fff; | |
border: 1px solid #DFDFDF; | |
border-radius: 0.5em; | |
overflow: hidden; | |
top: 3.5em; | |
width: 100%; | |
} | |
li{ | |
@include app-menu-action; | |
line-height: 2.5em; | |
height: 2.5em; | |
padding: 0 0.5em; | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment