Browse Source

Cleaned up the ui code, addressed warnings

1.0
Gisle Aune 6 years ago
parent
commit
388d5378e7
  1. 6
      rpdata-ui/src/App.js
  2. 6
      rpdata-ui/src/common/Background.js
  3. 6
      rpdata-ui/src/common/LoadingScreen.js
  4. 6
      rpdata-ui/src/common/Menu.js
  5. 4
      rpdata-ui/src/routes/logs/LogsMenu.js
  6. 6
      rpdata-ui/src/routes/logs/LogsRoot.js
  7. 4
      rpdata-ui/src/routes/story/StoryMenu.js
  8. 18
      rpdata-ui/src/routes/story/StoryRoot.js

6
rpdata-ui/src/App.js

@ -1,8 +1,8 @@
import React, { Component } from 'react'
import { Route, Router, Redirect, Switch } from "react-router-dom";
import { Route, Redirect, Switch } from "react-router-dom";
import StoryRoot from './routes/story/StoryRoot';
import LogsRoot from './routes/logs/LogsRoot';
import StoryRoot from './routes/story/StoryRoot'
import LogsRoot from './routes/logs/LogsRoot'
export default class App extends Component {
render() {

6
rpdata-ui/src/common/Background.js

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import './css/Background.css';
import React, { Component } from "react"
import "./css/Background.css"
/**
* Background renders a full-size image that detects whether the source is
@ -58,6 +58,6 @@ export default class Background extends Component {
const opacity = this.props.opacity || 0.25
const className = "Background" + (this.state.landscape ? " landscape" : "")
return <img style={{filter: `brightness(${(Number(opacity)) * 100}%)`}} ref={this.onRef.bind(this)} className={className} src={src} />
return <img alt="Background" style={{filter: `brightness(${(Number(opacity)) * 100}%)`}} ref={this.onRef.bind(this)} className={className} src={src} />
}
}

6
rpdata-ui/src/common/LoadingScreen.js

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import Background from "./Background";
import React from "react"
import Background from "./Background"
import './css/LoadingScreen.css';
import './css/LoadingScreen.css'
export function LoadingScreen({className}) {
return (

6
rpdata-ui/src/common/Menu.js

@ -1,7 +1,7 @@
import React, { Component } from 'react';
import { Link } from "react-router-dom";
import React, { Component } from "react"
import { Link } from "react-router-dom"
import './css/Menu.css';
import './css/Menu.css'
export default class Menu extends Component {
render() {

4
rpdata-ui/src/routes/logs/LogsMenu.js

@ -1,5 +1,5 @@
import React, { Component } from 'react';
import Menu, { MenuHeader, MenuLink, MenuGap } from '../../common/Menu';
import React, { Component } from "react"
import Menu, { MenuHeader, MenuLink, MenuGap } from '../../common/Menu'
export default class LogsMenu extends Component {
render() {

6
rpdata-ui/src/routes/logs/LogsRoot.js

@ -1,6 +1,6 @@
import React, { Component } from 'react';
import Background from '../../common/Background';
import LogsMenu from './LogsMenu';
import React, { Component } from "react"
import Background from "../../common/Background"
import LogsMenu from "./LogsMenu"
export default class LogsRoot extends Component {
render() {

4
rpdata-ui/src/routes/story/StoryMenu.js

@ -1,5 +1,5 @@
import React, { Component } from "react";
import Menu, { MenuHeader, MenuLink, MenuGap } from "../../common/Menu";
import React, { Component } from "react"
import Menu, { MenuHeader, MenuLink, MenuGap } from "../../common/Menu"
import pluralize from "pluralize"
export default class StoryMenu extends Component {

18
rpdata-ui/src/routes/story/StoryRoot.js

@ -1,11 +1,11 @@
import React, { Component } from 'react';
import { Query } from 'react-apollo';
import React, { Component } from "react"
import { Query } from "react-apollo"
import Background from '../../common/Background';
import StoryMenu from './StoryMenu';
import Background from "../../common/Background"
import StoryMenu from "./StoryMenu"
import storyRootQuery from "./gql/StoryRoot";
import { LoadingScreen } from '../../common/LoadingScreen';
import storyRootQuery from "./gql/StoryRoot"
import { LoadingScreen } from "../../common/LoadingScreen"
export class StoryIndex extends Component {
render() {
@ -23,10 +23,10 @@ export class StoryIndex extends Component {
export default () => (
<Query query={storyRootQuery}>
{({ loading, error, data }) => {
if (loading) return <LoadingScreen className="theme-story" />;
if (error) return `Error! ${error.message}`;
if (loading) return <LoadingScreen className="theme-story" />
if (error) return `Error! ${error.message}`
return <StoryIndex {...data} />
}}
</Query>
);
)
Loading…
Cancel
Save