Skip to content

Instantly share code, notes, and snippets.

@ilonacodes
Created December 28, 2018 18:28
Show Gist options
  • Save ilonacodes/1e615482ca9f03c958272a874c06cc09 to your computer and use it in GitHub Desktop.
Save ilonacodes/1e615482ca9f03c958272a874c06cc09 to your computer and use it in GitHub Desktop.
// ProgressBar.js
import React from 'react';
// the custom styling for progress bar app
import './progress-bar.css';
// pass percentRange state through props to Range an ProgressBar components
const Range = (props) => {
return (
// render current the filled range of progress bar along its width
<div className="range" style={{width: `${props.percentRange}%`}}/>
);
};
const ProgressBar = (props) => {
return (
<div className="progress-bar">
{/*render available progress bar’s limit*/}
<Range percentRange={props.percentRange}/>
</div>
);
};
...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment