// essentials
import React from 'react'
import { connect } from 'react-redux'
import store from '../../store'

const DisplayProgress = React.createClass({

    getInitialState() {
        return {
            start: 0,
            end: 100
        }
    },

    render() {

        const percent = (this.props.position) / (this.props.total)

        const len = (percent) ? `${percent * 100}%` : `0`

        return (
            <svg xmlns="http://www.w3.org/svg/2000"
                className='display__progress'>
                <line
                    x1={0}
                    x2={len}
                    y1='50%'
                    y2='50%'
                    />
            </svg>
        )
    }
})

const mapStateToProps = store => {
    return {
        position: Number(store.playerPosition[0]),
        total: Number(store.playerPosition[1])
    }
}

export default connect(mapStateToProps)(DisplayProgress)
@@ -132,151 +132,33 @@
 s = 
-React.createClass(%7B%0A%0A    getInitialState() %7B%0A        return %7B%0A            start: 0,%0A            end: 100%0A        %7D%0A    %7D,%0A%0A    render() %7B%0A%0A    
+(%7Bposition, total%7D) =%3E %7B%0A
     
@@ -177,28 +177,16 @@
 t = 
-(this.props.
 position
 ) / 
@@ -185,36 +185,17 @@
 tion
-)
  / 
-(this.props.total)%0A%0A    
+total%0A
     
@@ -244,25 +244,20 @@
 %60 : %600%60%0A
-%0A  
     
-  
 return (
@@ -257,20 +257,16 @@
 eturn (%0A
-    
         
@@ -317,20 +317,16 @@
         
-  
-  
 classNam
@@ -360,20 +360,16 @@
         
-    
 %3Cline%0A  
@@ -386,23 +386,15 @@
     
- 
-   
 x1=%7B0%7D%0A
-    
     
@@ -430,20 +430,16 @@
         
- 
-   
 y1='50%25'
@@ -435,28 +435,24 @@
    y1='50%25'%0A
-    
             
@@ -484,19 +484,11 @@
     
- 
-   /%3E%0A    
+/%3E%0A
     
@@ -506,22 +506,11 @@
     
- 
-   )%0A    %7D%0A%7D)
+)%0A%7D
 %0A%0Aco
@@ -544,27 +544,11 @@
  =%3E 
+(
 %7B%0A
-    return %7B%0A    
     
@@ -594,20 +594,16 @@
 %5D),%0A    
-   
- 
 total: N
@@ -637,15 +637,11 @@
 1%5D)%0A
-    %7D%0A%7D
+%7D)%0A
 %0A%0Aex

remove unused state