Makes Account view a modal
This commit is contained in:
parent
7b0d128082
commit
b16cb26a4b
3 changed files with 56 additions and 33 deletions
23
client/components/NavBasic.jsx
Normal file
23
client/components/NavBasic.jsx
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
import React from 'react';
|
||||||
|
import InlineSVG from 'react-inlinesvg';
|
||||||
|
|
||||||
|
const logoUrl = require('../images/p5js-logo-small.svg');
|
||||||
|
|
||||||
|
class NavBasic extends React.PureComponent {
|
||||||
|
|
||||||
|
render() {
|
||||||
|
return (
|
||||||
|
<nav className="nav" title="main-navigation" ref={(node) => { this.node = node; }}>
|
||||||
|
<ul className="nav__items-left" title="project-menu">
|
||||||
|
<li className="nav__item-logo">
|
||||||
|
<InlineSVG src={logoUrl} alt="p5.js logo" className="svg__logo" />
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</nav>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
NavBasic.propTypes = {};
|
||||||
|
|
||||||
|
export default NavBasic;
|
|
@ -12,9 +12,9 @@ import AccountForm from '../components/AccountForm';
|
||||||
import { validateSettings } from '../../../utils/reduxFormUtils';
|
import { validateSettings } from '../../../utils/reduxFormUtils';
|
||||||
import GithubButton from '../components/GithubButton';
|
import GithubButton from '../components/GithubButton';
|
||||||
import APIKeyForm from '../components/APIKeyForm';
|
import APIKeyForm from '../components/APIKeyForm';
|
||||||
|
import NavBasic from '../../../components/NavBasic';
|
||||||
|
|
||||||
const exitUrl = require('../../../images/exit.svg');
|
const exitUrl = require('../../../images/exit.svg');
|
||||||
const logoUrl = require('../../../images/p5js-logo.svg');
|
|
||||||
|
|
||||||
class AccountView extends React.Component {
|
class AccountView extends React.Component {
|
||||||
constructor(props) {
|
constructor(props) {
|
||||||
|
@ -24,7 +24,7 @@ class AccountView extends React.Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
componentDidMount() {
|
componentDidMount() {
|
||||||
document.body.className = 'light';
|
document.body.className = this.props.theme;
|
||||||
}
|
}
|
||||||
|
|
||||||
closeAccountPage() {
|
closeAccountPage() {
|
||||||
|
@ -37,20 +37,21 @@ class AccountView extends React.Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<section className="form-container form-container--align-top form-container--align-left user">
|
<React.Fragment>
|
||||||
<Helmet>
|
<Helmet>
|
||||||
<title>p5.js Web Editor | Account</title>
|
<title>p5.js Web Editor | Account</title>
|
||||||
</Helmet>
|
</Helmet>
|
||||||
<div className="form-container__header">
|
|
||||||
<button className="form-container__logo-button" onClick={this.gotoHomePage}>
|
<NavBasic />
|
||||||
<InlineSVG src={logoUrl} alt="p5js Logo" />
|
|
||||||
</button>
|
<section className="modal user">
|
||||||
<button className="form-container__exit-button" onClick={this.closeAccountPage}>
|
<div className="modal-content">
|
||||||
|
<div className="modal__header">
|
||||||
|
<h2 className="modal__title">My Account</h2>
|
||||||
|
<button className="modal__exit-button" onClick={this.closeAccountPage}>
|
||||||
<InlineSVG src={exitUrl} alt="Close Account Page" />
|
<InlineSVG src={exitUrl} alt="Close Account Page" />
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<div className="form-container__content">
|
|
||||||
<h2 className="form-container__title">My Account</h2>
|
|
||||||
<Tabs className="account__tabs">
|
<Tabs className="account__tabs">
|
||||||
<TabList>
|
<TabList>
|
||||||
<div className="tabs__titles">
|
<div className="tabs__titles">
|
||||||
|
@ -60,13 +61,11 @@ class AccountView extends React.Component {
|
||||||
</TabList>
|
</TabList>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<AccountForm {...this.props} />
|
<AccountForm {...this.props} />
|
||||||
<div className="account__social">
|
|
||||||
<h2 className="form-container__divider">Social Login</h2>
|
<h2 className="form-container__divider">Social Login</h2>
|
||||||
<p className="account__social__context">
|
<p className="account__social-text">
|
||||||
Link this account with your GitHub account to allow login from both.
|
Link this account with your GitHub account to allow login from both.
|
||||||
</p>
|
</p>
|
||||||
<GithubButton buttonText="Login with GitHub" />
|
<GithubButton buttonText="Login with GitHub" />
|
||||||
</div>
|
|
||||||
</TabPanel>
|
</TabPanel>
|
||||||
<TabPanel>
|
<TabPanel>
|
||||||
<APIKeyForm {...this.props} />
|
<APIKeyForm {...this.props} />
|
||||||
|
@ -74,6 +73,7 @@ class AccountView extends React.Component {
|
||||||
</Tabs>
|
</Tabs>
|
||||||
</div>
|
</div>
|
||||||
</section>
|
</section>
|
||||||
|
</React.Fragment>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -2,6 +2,6 @@
|
||||||
padding-top: #{20 / $base-font-size}rem;
|
padding-top: #{20 / $base-font-size}rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account__social__context {
|
.account__social-text {
|
||||||
padding-bottom: #{15 / $base-font-size}rem;
|
padding-bottom: #{15 / $base-font-size}rem;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue