-
-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Expand file tree
/
Copy pathFooterMenu.react.js
More file actions
59 lines (55 loc) · 2 KB
/
FooterMenu.react.js
File metadata and controls
59 lines (55 loc) · 2 KB
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
/*
* Copyright (c) 2016-present, Parse, LLC
* All rights reserved.
*
* This source code is licensed under the license found in the LICENSE file in
* the root directory of this source tree.
*/
import Icon from 'components/Icon/Icon.react';
import Popover from 'components/Popover/Popover.react';
import Position from 'lib/Position';
import React from 'react';
import styles from 'components/Sidebar/Sidebar.scss';
import { applyMountPath } from 'lib/path';
export default class FooterMenu extends React.Component {
constructor() {
super();
this.state = {
show: false,
position: null,
};
}
toggle() {
let pos = Position.inWindow(this.refs.more);
pos.x += 24;
this.setState({
show: true,
position: pos
});
}
render() {
let content = null;
if (this.state.show) {
content = (
<Popover
fixed={true}
position={this.state.position}
onExternalClick={() => this.setState({ show: false })}>
<div className={styles.popup}>
<a href={applyMountPath('logout')}>Log Out <span className={styles.emoji}>👋</span></a>
<a target='_blank' href='http://docs.parseplatform.org/parse-server/guide/'>Server Guide <span className={styles.emoji}>📚</span></a>
<a target='_blank' href='http://stackoverflow.com/questions/tagged/parse.com'>Code-level Questions <span className={styles.emoji}>❓</span></a>
<a target='_blank' href='http://stackoverflow.com/questions/tagged/parse-server'>Server Questions <span className={styles.emoji}>❓</span></a>
<a target='_blank' href='http://serverfault.com/tags/parse'>Deployment/Maintenance <span className={styles.emoji}>⚡️</span></a>
</div>
</Popover>
);
}
return (
<a onClick={this.toggle.bind(this)} ref='more' className={styles.more}>
<Icon height={24} width={24} name='ellipses' />
{content}
</a>
);
}
}