Skip to content

Commit

Permalink
fix: added data to chart #11
Browse files Browse the repository at this point in the history
  • Loading branch information
HammacheAbir committed May 24, 2021
1 parent 23fcd06 commit 503ae97
Show file tree
Hide file tree
Showing 7 changed files with 485 additions and 85 deletions.
243 changes: 227 additions & 16 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
"formik": "^2.2.6",
"legoino-util": "^1.3.0",
"lodash": "^4.17.21",
"ml-spectra-processing": "^6.5.0",
"mqtt": "^4.2.6",
"pouchdb": "^7.2.2",
"react": "^17.0.1",
Expand Down
18 changes: 9 additions & 9 deletions src/components/BroadCastDevicesDetails/ActualDetails.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ const ActualDetails = (props)=>{

useEffect(()=>{
if(props.DetailType){
//console.log(props.data)
const params = getParams(props.DetailType)
console.log(params)
setParameters(params)
}
},[props])
Expand All @@ -17,16 +17,16 @@ const ActualDetails = (props)=>{
<div >
{
parameters.length!==0?
<div class="sm:flex sm:space-x-4">
<div className="sm:flex sm:space-x-4">
{
parameters.map(p=>
parameters.map((p,key)=>
p.name!=='Date' && props.data[0]?
<div class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow transform transition-all mb-4 w-full sm:w-1/3 sm:my-8">
<div class="bg-white p-5">
<div class="sm:flex sm:items-start">
<div class="text-center sm:mt-0 sm:ml-2 sm:text-left">
<h3 class="text-sm leading-6 font-medium text-gray-400">{p.name}</h3>
<p class="text-3xl font-bold text-black">{eval('props.data[0].parameters.'+p.label)}</p>
<div key={key} className="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow transform transition-all mb-4 w-full sm:w-1/3 sm:my-8">
<div className="bg-white p-5">
<div className="sm:flex sm:items-start">
<div className="text-center sm:mt-0 sm:ml-2 sm:text-left">
<h3 className="text-sm leading-6 font-medium text-gray-400">{p.name}</h3>
<p className="text-3xl font-bold text-black">{eval('props.data[0].parameters.'+p.label)}</p>
</div>
</div>
</div>
Expand Down
Loading

0 comments on commit 503ae97

Please sign in to comment.