-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #143 from LD4P/rebase-internal-header
Rebase internal header -- LGTM
- Loading branch information
Showing
13 changed files
with
122 additions
and
64 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
import React from 'react' | ||
import { shallow } from 'enzyme' | ||
import EditorHeader from '../../src/components/EditorHeader' | ||
|
||
describe('<EditorHeader />', () => { | ||
const wrapper = shallow(<EditorHeader />) | ||
it ('displays the Sinopia text', () => { | ||
expect(wrapper.find("h1.editor-logo").text()).toBe("SINOPIA") | ||
}) | ||
}) |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,60 @@ | ||
import React from 'react' | ||
import React, { Component } from 'react' | ||
import { hot } from 'react-hot-loader' | ||
import HomePage from './HomePage' | ||
import '../styles/main.css' | ||
import Editor from './editor/Editor' | ||
|
||
import Footer from './Footer' | ||
import CanvasMenu from './CanvasMenu' | ||
import { OffCanvas, OffCanvasMenu, OffCanvasBody } from 'react-offcanvas' | ||
import { BrowserRouter, Route, Switch } from 'react-router-dom' | ||
|
||
const FourOhFour = () => <h1>404</h1> | ||
const App = () => ( | ||
<BrowserRouter> | ||
<div id="app"> | ||
<Switch> | ||
<Route exact path='/' component={HomePage} /> | ||
<Route exact path='/editor' component={Editor} /> | ||
<Route id="404" component={FourOhFour} /> | ||
</Switch> | ||
</div> | ||
</BrowserRouter> | ||
) | ||
class App extends Component{ | ||
constructor(props) { | ||
super(props) | ||
this.handleOffsetMenu = this.handleOffsetMenu.bind(this) | ||
this.closeMenu = this.closeMenu.bind(this) | ||
this.state = { | ||
isMenuOpened: false | ||
} | ||
} | ||
|
||
handleOffsetMenu() { | ||
console.log('AM I GETTING CLICKED?') | ||
this.setState({ | ||
isMenuOpened: !this.state.isMenuOpened | ||
}) | ||
} | ||
|
||
closeMenu() { | ||
this.setState({ | ||
isMenuOpened: false | ||
}) | ||
} | ||
render() { | ||
let offcanvas_class = this.state.isMenuOpened? "closeMargin" : null | ||
return( | ||
<div id="home-page"> | ||
<OffCanvas width={300} transitionDuration={300} isMenuOpened={this.state.isMenuOpened} position={"right"}> | ||
<OffCanvasBody className={offcanvas_class}> | ||
<BrowserRouter> | ||
<div id="app"> | ||
<Switch> | ||
<Route exact path='/' render={(props)=><HomePage {...props} triggerHandleOffsetMenu={this.handleOffsetMenu} />} /> | ||
<Route exact path='/editor' render={(props)=><Editor {...props} triggerHandleOffsetMenu={this.handleOffsetMenu} />} /> | ||
<Route id="404" component={FourOhFour} /> | ||
</Switch> | ||
<Footer /> | ||
</div> | ||
</BrowserRouter> | ||
</OffCanvasBody> | ||
<OffCanvasMenu className="offcanvas-menu"> | ||
<CanvasMenu closeHandleMenu={this.closeMenu} /> | ||
</OffCanvasMenu> | ||
</OffCanvas> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default hot(module)(App) |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import React, { Component } from 'react' | ||
import SinopiaLogo from '../styles/editorsinopialogo.png' | ||
import { Link } from 'react-router-dom' | ||
|
||
class EditorHeader extends Component { | ||
render() { | ||
return ( | ||
<div className="navbar editor-navbar"> | ||
<div> | ||
<h1 className="editor-logo"><a className="editor-navbar-brand navbar-brand" href="/">SINOPIA</a></h1> | ||
</div> | ||
<div> | ||
<ul className="nav navbar-nav pull-right"> | ||
<li> | ||
<a className="editor-header-text" href="https://profile-editor.sinopia.io/">Profile Editor</a> | ||
</li> | ||
<li className="menu"> | ||
<a href="#" className="editor-help-resources" onClick={this.props.triggerEditorMenu}>Help and Resources</a> | ||
</li> | ||
</ul> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default EditorHeader |
This file contains 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
This file contains 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
This file contains 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
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains 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