Fix linting issues.
This commit is contained in:
parent
96ba089d89
commit
3e8190537e
|
@ -63,8 +63,8 @@
|
||||||
"react/jsx-filename-extension": 0,
|
"react/jsx-filename-extension": 0,
|
||||||
"react/jsx-equals-spacing": 1,
|
"react/jsx-equals-spacing": 1,
|
||||||
"react/jsx-handler-names": 1,
|
"react/jsx-handler-names": 1,
|
||||||
"react/jsx-indent-props": 1,
|
"react/jsx-indent-props": [1, 2],
|
||||||
"react/jsx-indent": 1,
|
"react/jsx-indent": [1, 2],
|
||||||
"react/jsx-key": 1,
|
"react/jsx-key": 1,
|
||||||
"react/jsx-max-props-per-line": 0,
|
"react/jsx-max-props-per-line": 0,
|
||||||
"react/jsx-no-bind": 1,
|
"react/jsx-no-bind": 1,
|
||||||
|
|
|
@ -35,34 +35,34 @@ class App extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Container>
|
<Container>
|
||||||
{/*TODO Extract as header container.*/}
|
{/*TODO Extract as header container.*/}
|
||||||
<Row className="justify-content-around">
|
<Row className="justify-content-around">
|
||||||
<Col lg="4">
|
<Col lg="4">
|
||||||
<ConnectedUserLogin />
|
<ConnectedUserLogin />
|
||||||
</Col>
|
</Col>
|
||||||
<Col lg="4">
|
<Col lg="4">
|
||||||
<ConnectedThemeSwitchView />
|
<ConnectedThemeSwitchView />
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{/*TODO Extract as site header container.*/}
|
{/*TODO Extract as site header container.*/}
|
||||||
<SiteHeader siteName={ this.props.siteName } logo={ this.props.logo } tagline={ this.props.tagline } />
|
<SiteHeader siteName={ this.props.siteName } logo={ this.props.logo } tagline={ this.props.tagline } />
|
||||||
|
|
||||||
{/*TODO Extract as Main body and navigation sidebar containers.*/}
|
{/*TODO Extract as Main body and navigation sidebar containers.*/}
|
||||||
<Row className="justify-content-center">
|
<Row className="justify-content-center">
|
||||||
<ConnectedNavigationMenu />
|
<ConnectedNavigationMenu />
|
||||||
<Col lg="8" className="ice-floe">
|
<Col lg="8" className="ice-floe">
|
||||||
<Switch>
|
<Switch>
|
||||||
<Route exact path="/" component={ ConnectedArticle } />
|
<Route exact path="/" component={ ConnectedArticle } />
|
||||||
<Route path="/:pageId" component={ ConnectedArticle } />
|
<Route path="/:pageId" component={ ConnectedArticle } />
|
||||||
</Switch>
|
</Switch>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
|
|
||||||
{/*TODO Extract as site footer container.*/}
|
{/*TODO Extract as site footer container.*/}
|
||||||
<SiteFooter footer={ this.props.footer } />
|
<SiteFooter footer={ this.props.footer } />
|
||||||
</Container>
|
</Container>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
10
src/entry.js
10
src/entry.js
|
@ -24,11 +24,11 @@ const location = window.location.pathname.substring(1);
|
||||||
appStore.dispatch(fetchPage(location));
|
appStore.dispatch(fetchPage(location));
|
||||||
|
|
||||||
const RookeriesWiredApp = (
|
const RookeriesWiredApp = (
|
||||||
<Provider store={ appStore }>
|
<Provider store={ appStore }>
|
||||||
<BrowserRouter>
|
<BrowserRouter>
|
||||||
<WiredApp />
|
<WiredApp />
|
||||||
</BrowserRouter>
|
</BrowserRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
);
|
);
|
||||||
|
|
||||||
render(RookeriesWiredApp, document.getElementById("ui-target"));
|
render(RookeriesWiredApp, document.getElementById("ui-target"));
|
||||||
|
|
|
@ -24,11 +24,11 @@ export function renderReactComponentsToString() {
|
||||||
const context = {};
|
const context = {};
|
||||||
return {
|
return {
|
||||||
bodyContent: render(h(
|
bodyContent: render(h(
|
||||||
<Provider store={ serverSideStore }>
|
<Provider store={ serverSideStore }>
|
||||||
<StaticRouter location={ url } context={ context }>
|
<StaticRouter location={ url } context={ context }>
|
||||||
<WiredApp />
|
<WiredApp />
|
||||||
</StaticRouter>
|
</StaticRouter>
|
||||||
</Provider>
|
</Provider>
|
||||||
))
|
))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -16,7 +16,7 @@ import PropTypes from "prop-types";
|
||||||
see issue https://github.com/JedWatson/react-codemirror/issues/34
|
see issue https://github.com/JedWatson/react-codemirror/issues/34
|
||||||
Also add in the themes in the CSS to get proper theming support.
|
Also add in the themes in the CSS to get proper theming support.
|
||||||
*/
|
*/
|
||||||
import CodeMirror from "react-codemirror";
|
import CodeMirror from "react-codemirror2";
|
||||||
// TODO: Figure out how to work around this import.
|
// TODO: Figure out how to work around this import.
|
||||||
|
|
||||||
// Workaround for rendering CodeMirror server-side
|
// Workaround for rendering CodeMirror server-side
|
||||||
|
|
|
@ -146,22 +146,22 @@ export class JournalMarkdownView extends Component {
|
||||||
|
|
||||||
// # TODO Factor the view into something nicer.
|
// # TODO Factor the view into something nicer.
|
||||||
let showEditorButton = (
|
let showEditorButton = (
|
||||||
<Button onClick={ this.handleToggleEditorPane }>
|
<Button onClick={ this.handleToggleEditorPane }>
|
||||||
<FontAwesome name="edit"/> Edit
|
<FontAwesome name="edit"/> Edit
|
||||||
</Button>
|
</Button>
|
||||||
);
|
);
|
||||||
|
|
||||||
// # TODO Add in ability to display mhessages outside the collapsible pane
|
// # TODO Add in ability to display mhessages outside the collapsible pane
|
||||||
let showPanel = (
|
let showPanel = (
|
||||||
<Collapse isOpen={ this.isEditorPaneOpen() }>
|
<Collapse isOpen={ this.isEditorPaneOpen() }>
|
||||||
<CodeMirror
|
<CodeMirror
|
||||||
autoFocus="true"
|
autoFocus="true"
|
||||||
value={ code }
|
value={ code }
|
||||||
onChange={ this.handleUpdateCode }
|
onChange={ this.handleUpdateCode }
|
||||||
options={{ mode: "markdown", theme: this.props.editorTheme }} />
|
options={{ mode: "markdown", theme: this.props.editorTheme }} />
|
||||||
<Button onClick={ this.handleSaveContent }><FontAwesome name="save"/> Save </Button>
|
<Button onClick={ this.handleSaveContent }><FontAwesome name="save"/> Save </Button>
|
||||||
<Button onClick={ this.handleResetContent }><FontAwesome name="undo"/> Reset </Button>
|
<Button onClick={ this.handleResetContent }><FontAwesome name="undo"/> Reset </Button>
|
||||||
</Collapse>
|
</Collapse>
|
||||||
);
|
);
|
||||||
if (this.state.editorPaneState === EditorPaneState.hidden) {
|
if (this.state.editorPaneState === EditorPaneState.hidden) {
|
||||||
showEditorButton = (<div />);
|
showEditorButton = (<div />);
|
||||||
|
@ -169,12 +169,12 @@ export class JournalMarkdownView extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<h1>{ this.props.title }</h1>
|
<h1>{ this.props.title }</h1>
|
||||||
<span dangerouslySetInnerHTML={{ __html: rawMarkup }} />
|
<span dangerouslySetInnerHTML={{ __html: rawMarkup }} />
|
||||||
{ showEditorButton }
|
{ showEditorButton }
|
||||||
{ showPanel }
|
{ showPanel }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -25,11 +25,11 @@ class NavigationMenuItem extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<NavItem>
|
<NavItem>
|
||||||
<NavLink>
|
<NavLink>
|
||||||
<Link to={ this.props.url }>{ this.props.title }</Link>
|
<Link to={ this.props.url }>{ this.props.title }</Link>
|
||||||
</NavLink>
|
</NavLink>
|
||||||
</NavItem>);
|
</NavItem>);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -52,17 +52,17 @@ class NavigationMenu extends Component {
|
||||||
let menuId = `${menuItem.title.toLowerCase()}_${menuItem.url.substring(1, menuItem.url.length)}`;
|
let menuId = `${menuItem.title.toLowerCase()}_${menuItem.url.substring(1, menuItem.url.length)}`;
|
||||||
// TODO Fix API for application menu.
|
// TODO Fix API for application menu.
|
||||||
let menu = (
|
let menu = (
|
||||||
<NavigationMenuItem key={ menuId } title={ menuItem.title } url={ menuItem.url }/>
|
<NavigationMenuItem key={ menuId } title={ menuItem.title } url={ menuItem.url }/>
|
||||||
);
|
);
|
||||||
navigationMenuItems.push(menu);
|
navigationMenuItems.push(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Col lg="3">
|
<Col lg="3">
|
||||||
<Nav pills vertical className="ice-menu">
|
<Nav pills vertical className="ice-menu">
|
||||||
{ navigationMenuItems }
|
{ navigationMenuItems }
|
||||||
</Nav>
|
</Nav>
|
||||||
</Col>
|
</Col>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -22,11 +22,11 @@ export class SiteFooter extends Component {
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
return (
|
return (
|
||||||
<Row className="justify-content-end">
|
<Row className="justify-content-end">
|
||||||
<Col lg="8">
|
<Col lg="8">
|
||||||
<footer>{ this.props.footer }</footer>
|
<footer>{ this.props.footer }</footer>
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -24,20 +24,20 @@ export class SiteHeader extends Component {
|
||||||
render() {
|
render() {
|
||||||
let headerLogoAltText = `${this.props.siteName} logo`;
|
let headerLogoAltText = `${this.props.siteName} logo`;
|
||||||
return (
|
return (
|
||||||
<Row className="justify-content-around">
|
<Row className="justify-content-around">
|
||||||
<Col lg="11">
|
<Col lg="11">
|
||||||
<Row className="sea-header justify-content-center align-items-center">
|
<Row className="sea-header justify-content-center align-items-center">
|
||||||
<Col lg="2">
|
<Col lg="2">
|
||||||
<img className="header_logo" src={ this.props.logo } alt={ headerLogoAltText }/>
|
<img className="header_logo" src={ this.props.logo } alt={ headerLogoAltText }/>
|
||||||
</Col>
|
|
||||||
<Col lg="4">
|
|
||||||
<h1 className="header_title">{ this.props.siteName }</h1>
|
|
||||||
|
|
||||||
<h2 className="header_tagline">{ this.props.tagline }</h2>
|
|
||||||
</Col>
|
|
||||||
</Row>
|
|
||||||
</Col>
|
</Col>
|
||||||
</Row>
|
<Col lg="4">
|
||||||
|
<h1 className="header_title">{ this.props.siteName }</h1>
|
||||||
|
|
||||||
|
<h2 className="header_tagline">{ this.props.tagline }</h2>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
|
</Col>
|
||||||
|
</Row>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,10 +31,10 @@ export class ThemeSwitchView extends Component {
|
||||||
render() {
|
render() {
|
||||||
let changeThemeText = `Change to ${this.props.alternativeTheme} theme`;
|
let changeThemeText = `Change to ${this.props.alternativeTheme} theme`;
|
||||||
return (
|
return (
|
||||||
<div className="text-center muted hoverable" onClick={ this.handleSwitchTheme }>
|
<div className="text-center muted hoverable" onClick={ this.handleSwitchTheme }>
|
||||||
<FontAwesome name="eye" />
|
<FontAwesome name="eye" />
|
||||||
{ changeThemeText }
|
{ changeThemeText }
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,9 +116,9 @@ export class UserLoginView extends Component {
|
||||||
let loginButtonDisabled = this.state.username === "" || this.state.password === "";
|
let loginButtonDisabled = this.state.username === "" || this.state.password === "";
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<div className="text-center muted hoverable" onClick={ loginOperation }>
|
<div className="text-center muted hoverable" onClick={ loginOperation }>
|
||||||
<FontAwesome name="user"/>
|
<FontAwesome name="user"/>
|
||||||
|
|
||||||
Hello { this.props.fullName }!
|
Hello { this.props.fullName }!
|
||||||
 
|
 
|
||||||
|
@ -126,41 +126,41 @@ export class UserLoginView extends Component {
|
||||||
|
|
||||||
Do you want to { loginMessage }?
|
Do you want to { loginMessage }?
|
||||||
</div>
|
</div>
|
||||||
<Modal isOpen={ this.state.displayLoginModal } toggle={ this.handleHideLoginModal } onKeyPress={ this.handleKeyboardLogin }>
|
<Modal isOpen={ this.state.displayLoginModal } toggle={ this.handleHideLoginModal } onKeyPress={ this.handleKeyboardLogin }>
|
||||||
<ModalHeader toggle={ this.handleHideLoginModal }>
|
<ModalHeader toggle={ this.handleHideLoginModal }>
|
||||||
User Login
|
User Login
|
||||||
</ModalHeader>
|
</ModalHeader>
|
||||||
|
|
||||||
<ModalBody>
|
<ModalBody>
|
||||||
{errorDisplay}
|
{errorDisplay}
|
||||||
<Form horizontal>
|
<Form horizontal>
|
||||||
<FormGroup row>
|
<FormGroup row>
|
||||||
<Col xs="2">
|
<Col xs="2">
|
||||||
<Label for="username">Username</Label>
|
<Label for="username">Username</Label>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs="10" >
|
<Col xs="10" >
|
||||||
<Input id="username" type="text" placeholder="Username"
|
<Input id="username" type="text" placeholder="Username"
|
||||||
value={ this.state.username } onChange={ this.handleUsernameUpdate } />
|
value={ this.state.username } onChange={ this.handleUsernameUpdate } />
|
||||||
</Col>
|
</Col>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
<FormGroup row>
|
<FormGroup row>
|
||||||
<Col xs="2">
|
<Col xs="2">
|
||||||
<Label for="password">Password</Label>
|
<Label for="password">Password</Label>
|
||||||
</Col>
|
</Col>
|
||||||
<Col xs="10">
|
<Col xs="10">
|
||||||
<Input id="password" type="password" placeholder="***"
|
<Input id="password" type="password" placeholder="***"
|
||||||
value={ this.state.password } onChange={ this.handlePasswordUpdate } />
|
value={ this.state.password } onChange={ this.handlePasswordUpdate } />
|
||||||
</Col>
|
</Col>
|
||||||
</FormGroup>
|
</FormGroup>
|
||||||
</Form>
|
</Form>
|
||||||
</ModalBody>
|
</ModalBody>
|
||||||
|
|
||||||
<ModalFooter>
|
<ModalFooter>
|
||||||
<Button color="warning" onClick={ this.handleHideLoginModal }>Cancel</Button>
|
<Button color="warning" onClick={ this.handleHideLoginModal }>Cancel</Button>
|
||||||
<Button color="primary" onClick={ this.handleLoginAttempt } disabled={ loginButtonDisabled }>Login</Button>
|
<Button color="primary" onClick={ this.handleLoginAttempt } disabled={ loginButtonDisabled }>Login</Button>
|
||||||
</ModalFooter>
|
</ModalFooter>
|
||||||
</Modal>
|
</Modal>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue