-
Notifications
You must be signed in to change notification settings - Fork 0
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 #3 from isr-ifi/feat/extended-visual-components
feat(components): register new visual components
- Loading branch information
Showing
11 changed files
with
122 additions
and
93 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
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,103 +1,99 @@ | ||
import { faAngleDoubleUp } from '@fortawesome/free-solid-svg-icons'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import React, { Component } from 'react'; | ||
import { ReactSVG } from 'react-svg'; | ||
|
||
import ReactSVG from 'react-svg'; | ||
|
||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' | ||
import { faAngleDoubleUp, faAngleUp, faMinus, faAngleDoubleDown, faAngleDown } from '@fortawesome/free-solid-svg-icons' | ||
|
||
import VerticalBar from "../Elements/VerticalBar"; | ||
|
||
import step_1 from './img/Infrastruktur_1.svg' | ||
import step_2 from './img/Infrastruktur_2.svg' | ||
import step_3 from './img/Infrastruktur_3.svg' | ||
import step_4 from './img/Infrastruktur_4.svg' | ||
import step_5 from './img/Infrastruktur_5.svg' | ||
|
||
import roll_icon from '../../../icons/rolls/Planer.svg' | ||
import roll_icon from '../../../icons/rolls/Planer.svg'; | ||
import VerticalBar from '../Elements/VerticalBar'; | ||
import step_1 from './img/Infrastruktur_1.svg'; | ||
import step_2 from './img/Infrastruktur_2.svg'; | ||
import step_3 from './img/Infrastruktur_3.svg'; | ||
import step_4 from './img/Infrastruktur_4.svg'; | ||
import step_5 from './img/Infrastruktur_5.svg'; | ||
|
||
class Planer extends React.Component { | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.settings = { | ||
title: "Test", | ||
|
||
show_infographic: true, | ||
show_progress: true, | ||
show_flow: true | ||
}; | ||
|
||
this.state = { | ||
progress: 0, | ||
steps: [ | ||
step_1, | ||
step_2, | ||
step_3, | ||
step_4, | ||
step_5 | ||
], | ||
step_nr: 0, | ||
} | ||
|
||
constructor(props) { | ||
super(props); | ||
|
||
this.settings = { | ||
title: "Test", | ||
|
||
show_infographic: true, | ||
show_progress: true, | ||
show_flow: true | ||
}; | ||
|
||
this.state = { | ||
progress: 0, | ||
steps: [ | ||
step_1, | ||
step_2, | ||
step_3, | ||
step_4, | ||
step_5 | ||
], | ||
step_nr: 0, | ||
} | ||
|
||
componentDidMount() { | ||
setInterval(() => { | ||
this.setState(prevState => ({ | ||
progress: | ||
(prevState.progress + Math.floor(Math.random() * 1) + 1) % 100 | ||
|
||
})); | ||
|
||
if (this.state.progress < 20) { | ||
this.setState({step_nr: 0}) | ||
} else if (this.state.progress < 40) { | ||
this.setState({step_nr: 1}) | ||
} else if (this.state.progress < 60) { | ||
this.setState({step_nr: 2}) | ||
} else if (this.state.progress < 80) { | ||
this.setState({step_nr: 3}) | ||
} else { | ||
this.setState({step_nr: 4}) | ||
} | ||
}, 100); | ||
|
||
|
||
} | ||
|
||
|
||
render(){ | ||
return ( | ||
<div className={`card card-planer step_${this.state.step_nr+1}`}> | ||
<div className={"row card-header"}> | ||
<div className={"roll-logo col-md-1"}> | ||
<ReactSVG className={"roll-svg"} src={roll_icon} /> | ||
</div> | ||
<div className={"roll-title col-md-10"}> | ||
<h4>Infrastruktur</h4> | ||
</div> | ||
</div> | ||
|
||
<div className={"row card-content"}> | ||
<div className={"col goal-context col-md-10"}> | ||
<img src={this.state.steps[this.state.step_nr]} className="App-logo" alt="logo" /> | ||
</div> | ||
|
||
<div className={"col goal-chart col-md-2"}> | ||
<div className={"goal-state-container"}> | ||
<div className={"goal-flow"}> | ||
<FontAwesomeIcon icon={ faAngleDoubleUp } /> | ||
</div> | ||
<div className={"goal-stock"}> | ||
<VerticalBar progress={this.state.progress} roll={"planer"}/> | ||
</div> | ||
</div> | ||
</div> | ||
</div> | ||
} | ||
|
||
componentDidMount() { | ||
setInterval(() => { | ||
this.setState(prevState => ({ | ||
progress: | ||
(prevState.progress + Math.floor(Math.random() * 1) + 1) % 100 | ||
|
||
})); | ||
|
||
if (this.state.progress < 20) { | ||
this.setState({ step_nr: 0 }) | ||
} else if (this.state.progress < 40) { | ||
this.setState({ step_nr: 1 }) | ||
} else if (this.state.progress < 60) { | ||
this.setState({ step_nr: 2 }) | ||
} else if (this.state.progress < 80) { | ||
this.setState({ step_nr: 3 }) | ||
} else { | ||
this.setState({ step_nr: 4 }) | ||
} | ||
}, 100); | ||
|
||
|
||
} | ||
|
||
|
||
render() { | ||
return ( | ||
<div className={`card card-planer step_${this.state.step_nr + 1}`}> | ||
<div className={"row card-header"}> | ||
<div className={"roll-logo col-md-1"}> | ||
<ReactSVG className={"roll-svg"} src={roll_icon} /> | ||
</div> | ||
<div className={"roll-title col-md-10"}> | ||
<h4>Infrastruktur</h4> | ||
</div> | ||
</div> | ||
|
||
<div className={"row card-content"}> | ||
<div className={"col goal-context col-md-10"}> | ||
<img src={this.state.steps[this.state.step_nr]} className="App-logo" alt="logo" /> | ||
</div> | ||
|
||
<div className={"col goal-chart col-md-2"}> | ||
<div className={"goal-state-container"}> | ||
<div className={"goal-flow"}> | ||
<FontAwesomeIcon icon={faAngleDoubleUp} /> | ||
</div> | ||
<div className={"goal-stock"}> | ||
<VerticalBar progress={this.state.progress} roll={"planer"} /> | ||
</div> | ||
</div> | ||
) | ||
} | ||
</div> | ||
</div> | ||
</div> | ||
) | ||
} | ||
} | ||
|
||
export default Planer |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
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