get account menu and invite lightbox working
This commit is contained in:
parent
871c491097
commit
e4e062b76e
5 changed files with 21 additions and 21 deletions
|
@ -7,27 +7,19 @@ const Account = {
|
||||||
changing: false,
|
changing: false,
|
||||||
init: function() {
|
init: function() {
|
||||||
var self = Account
|
var self = Account
|
||||||
|
|
||||||
$('.sidebarAccountIcon').click(self.toggleBox)
|
$('.sidebarAccountIcon').click(self.toggleBox)
|
||||||
$('.sidebarAccountBox').click(function(event) {
|
|
||||||
event.stopPropagation()
|
|
||||||
})
|
|
||||||
$('body').click(self.close)
|
$('body').click(self.close)
|
||||||
},
|
},
|
||||||
toggleBox: function(event) {
|
toggleBox: function(event) {
|
||||||
var self = Account
|
var self = Account
|
||||||
|
|
||||||
if (self.isOpen) self.close()
|
if (self.isOpen) self.close()
|
||||||
else self.open()
|
else self.open()
|
||||||
|
|
||||||
event.stopPropagation()
|
event.stopPropagation()
|
||||||
},
|
},
|
||||||
open: function() {
|
open: function() {
|
||||||
var self = Account
|
var self = Account
|
||||||
|
|
||||||
Filter.close()
|
Filter.close()
|
||||||
$('.sidebarAccountIcon .tooltipsUnder').addClass('hide')
|
$('.sidebarAccountIcon .tooltipsUnder').addClass('hide')
|
||||||
|
|
||||||
if (!self.isOpen && !self.changing) {
|
if (!self.isOpen && !self.changing) {
|
||||||
self.changing = true
|
self.changing = true
|
||||||
$('.sidebarAccountBox').fadeIn(200, function() {
|
$('.sidebarAccountBox').fadeIn(200, function() {
|
||||||
|
@ -39,7 +31,6 @@ const Account = {
|
||||||
},
|
},
|
||||||
close: function() {
|
close: function() {
|
||||||
var self = Account
|
var self = Account
|
||||||
|
|
||||||
$('.sidebarAccountIcon .tooltipsUnder').removeClass('hide')
|
$('.sidebarAccountIcon .tooltipsUnder').removeClass('hide')
|
||||||
if (!self.changing) {
|
if (!self.changing) {
|
||||||
self.changing = true
|
self.changing = true
|
||||||
|
|
|
@ -76,7 +76,8 @@ const ReactApp = {
|
||||||
mobile: self.mobile,
|
mobile: self.mobile,
|
||||||
mobileTitle: self.mobileTitle,
|
mobileTitle: self.mobileTitle,
|
||||||
mobileTitleWidth: self.mobileTitleWidth,
|
mobileTitleWidth: self.mobileTitleWidth,
|
||||||
mobileTitleClick: (e) => Active.Map && InfoBox.toggleBox(e)
|
mobileTitleClick: (e) => Active.Map && InfoBox.toggleBox(e),
|
||||||
|
openInviteLightbox: () => self.openLightbox('invite')
|
||||||
},
|
},
|
||||||
self.getMapProps(),
|
self.getMapProps(),
|
||||||
self.getTopicProps(),
|
self.getTopicProps(),
|
||||||
|
|
|
@ -2,17 +2,19 @@ import React, { Component, PropTypes } from 'react'
|
||||||
|
|
||||||
class AccountMenu extends Component {
|
class AccountMenu extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
currentUser: PropTypes.object
|
currentUser: PropTypes.object,
|
||||||
|
onInviteClick: PropTypes.func
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
|
const { currentUser, onInviteClick } = this.props
|
||||||
return <div>
|
return <div>
|
||||||
<img className="sidebarAccountImage" src="https://metamaps-live.s3.amazonaws.com/users/images/555/629/996/sixtyfour/11835c3.png?1417298429" alt="11835c3" width="48" height="48" />
|
<img className="sidebarAccountImage" src={currentUser.get('image')} width="48" height="48" />
|
||||||
<h3 className="accountHeader">Connor</h3>
|
<h3 className="accountHeader">{currentUser.get('name')}</h3>
|
||||||
<ul>
|
<ul>
|
||||||
<li className="accountListItem accountSettings">
|
<li className="accountListItem accountSettings">
|
||||||
<div className="accountIcon"></div>
|
<div className="accountIcon"></div>
|
||||||
<a href="https://metamaps.cc/users/555629996/edit">Settings</a>
|
<a href={`/users/${currentUser.id}/edit`}>Settings</a>
|
||||||
</li>
|
</li>
|
||||||
<li className="accountListItem accountAdmin">
|
<li className="accountListItem accountAdmin">
|
||||||
<div className="accountIcon"></div>
|
<div className="accountIcon"></div>
|
||||||
|
@ -22,7 +24,7 @@ class AccountMenu extends Component {
|
||||||
<div className="accountIcon"></div>
|
<div className="accountIcon"></div>
|
||||||
<a href="/oauth/authorized_applications">Apps</a>
|
<a href="/oauth/authorized_applications">Apps</a>
|
||||||
</li>
|
</li>
|
||||||
<li className="accountListItem accountInvite openLightbox" data-open="invite">
|
<li className="accountListItem accountInvite" onClick={onInviteClick}>
|
||||||
<div className="accountIcon"></div>
|
<div className="accountIcon"></div>
|
||||||
<span>Share Invite</span>
|
<span>Share Invite</span>
|
||||||
</li>
|
</li>
|
||||||
|
|
|
@ -8,7 +8,8 @@ class UpperRightUI extends Component {
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
currentUser: PropTypes.object,
|
currentUser: PropTypes.object,
|
||||||
signInPage: PropTypes.bool,
|
signInPage: PropTypes.bool,
|
||||||
unreadNotificationsCount: PropTypes.number
|
unreadNotificationsCount: PropTypes.number,
|
||||||
|
openInviteLightbox: PropTypes.func
|
||||||
}
|
}
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
|
@ -16,7 +17,7 @@ class UpperRightUI extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { currentUser, signInPage, unreadNotificationsCount } = this.props
|
const { currentUser, signInPage, unreadNotificationsCount, openInviteLightbox } = this.props
|
||||||
return <div className="upperRightUI">
|
return <div className="upperRightUI">
|
||||||
{currentUser && <a href="/maps/new" target="_blank" className="addMap upperRightEl upperRightIcon">
|
{currentUser && <a href="/maps/new" target="_blank" className="addMap upperRightEl upperRightIcon">
|
||||||
<div className="tooltipsUnder">
|
<div className="tooltipsUnder">
|
||||||
|
@ -33,7 +34,9 @@ class UpperRightUI extends Component {
|
||||||
{!currentUser && <div className="accountInnerArrow"></div>}
|
{!currentUser && <div className="accountInnerArrow"></div>}
|
||||||
</div>
|
</div>
|
||||||
<div className="sidebarAccountBox upperRightBox">
|
<div className="sidebarAccountBox upperRightBox">
|
||||||
{currentUser ? <AccountMenu /> : <LoginForm />}
|
{currentUser
|
||||||
|
? <AccountMenu onInviteClick={openInviteLightbox} currentUser={currentUser} />
|
||||||
|
: <LoginForm />}
|
||||||
</div>
|
</div>
|
||||||
</div>}
|
</div>}
|
||||||
<div className="clearfloat"></div>
|
<div className="clearfloat"></div>
|
||||||
|
|
|
@ -14,7 +14,8 @@ class App extends Component {
|
||||||
mobile: PropTypes.bool,
|
mobile: PropTypes.bool,
|
||||||
mobileTitle: PropTypes.string,
|
mobileTitle: PropTypes.string,
|
||||||
mobileTitleWidth: PropTypes.number,
|
mobileTitleWidth: PropTypes.number,
|
||||||
mobileTitleClick: PropTypes.func
|
mobileTitleClick: PropTypes.func,
|
||||||
|
openInviteLightbox: PropTypes.func
|
||||||
}
|
}
|
||||||
|
|
||||||
static childContextTypes = {
|
static childContextTypes = {
|
||||||
|
@ -28,7 +29,7 @@ class App extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
const { children, toast, currentUser, unreadNotificationsCount,
|
const { children, toast, currentUser, unreadNotificationsCount, openInviteLightbox,
|
||||||
mobile, mobileTitle, mobileTitleWidth, mobileTitleClick } = this.props
|
mobile, mobileTitle, mobileTitleWidth, mobileTitleClick } = this.props
|
||||||
return <div className="wrapper" id="wrapper">
|
return <div className="wrapper" id="wrapper">
|
||||||
{mobile && <MobileHeader currentUser={currentUser}
|
{mobile && <MobileHeader currentUser={currentUser}
|
||||||
|
@ -37,7 +38,9 @@ class App extends Component {
|
||||||
mobileTitleWidth={mobileTitleWidth}
|
mobileTitleWidth={mobileTitleWidth}
|
||||||
onTitleClick={mobileTitleClick} />}
|
onTitleClick={mobileTitleClick} />}
|
||||||
<UpperLeftUI currentUser={currentUser} />
|
<UpperLeftUI currentUser={currentUser} />
|
||||||
{!mobile && <UpperRightUI currentUser={currentUser} unreadNotificationsCount={unreadNotificationsCount} />}
|
{!mobile && <UpperRightUI currentUser={currentUser}
|
||||||
|
unreadNotificationsCount={unreadNotificationsCount}
|
||||||
|
openInviteLightbox={openInviteLightbox} />}
|
||||||
<Toast message={toast} />
|
<Toast message={toast} />
|
||||||
{!mobile && currentUser && <a className='feedback-icon' target='_blank' href='https://hylo.com/c/metamaps'></a>}
|
{!mobile && currentUser && <a className='feedback-icon' target='_blank' href='https://hylo.com/c/metamaps'></a>}
|
||||||
{children}
|
{children}
|
||||||
|
|
Loading…
Add table
Reference in a new issue