-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fixed icons size * fixed icons size (#86) * created an InitialDisplay component to render on CDM * Removed console.log - preparing for merge to master * Removed console.log and restyled codebase to airbnb standards * removed styles.css file * updated manifest and icons * Update README
- Loading branch information
1 parent
7dc2237
commit 975b25e
Showing
29 changed files
with
162 additions
and
150 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
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
19 changes: 19 additions & 0 deletions
19
src/app/components/DetailCards/InitialDetailCard/InitialDisplay.jsx
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 |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import React from 'react'; | ||
import ReactJson from 'react-json-view'; | ||
|
||
// styled components | ||
import { DetailsWrapper } from '../../../styles/Details.jsx'; | ||
|
||
export default function InitialDisplay({ action }) { | ||
// renders action information | ||
return ( | ||
<DetailsWrapper> | ||
{<ReactJson | ||
theme="threezerotwofour" | ||
style={{ backgroundColor: 'transparent' }} | ||
displayDataTypes={false} | ||
src={action} | ||
/> || 'select an event'} | ||
</DetailsWrapper> | ||
); | ||
} |
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
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,39 +1,34 @@ | ||
|
||
function stateDifference(old, curr) { | ||
if (typeof old !== typeof curr) return curr; | ||
|
||
if(typeof(old) === "string" && typeof(curr) === "string") { | ||
if(old === curr) return false; | ||
if (typeof old === typeof curr && !Array.isArray(old) && typeof old !== 'object') { | ||
if (old === curr) return undefined; | ||
return curr; | ||
} | ||
else if(typeof(old) === "number" && typeof(curr) === "number") { | ||
if( old === curr) return false; | ||
return curr; | ||
} | ||
else if(typeof(old) !== typeof(curr)) { | ||
return curr; | ||
} | ||
else if(Array.isArray(old) && Array.isArray(curr)) { | ||
let newArr = []; | ||
for ( let i = 0; i < curr.length; i++){ | ||
if(!old.includes(curr[i])){ | ||
let result = stateDifference(old[i], curr[i]) | ||
if (result) { | ||
newArr.push(result) | ||
|
||
if (Array.isArray(old) && Array.isArray(curr)) { | ||
const newArr = []; | ||
for (let i = 0; i < curr.length; i++) { | ||
if (!old.includes(curr[i])) { | ||
const result = stateDifference(old[i], curr[i]); | ||
if (result !== undefined) { | ||
newArr.push(result); | ||
} | ||
} | ||
} | ||
return newArr.length > 0 ? newArr : false; | ||
} | ||
|
||
return newArr.length > 0 ? newArr : undefined; | ||
} | ||
else if(typeof(old) === "object" && typeof(curr) === "object") { | ||
let newObj = {} | ||
for ( let prop in curr) { | ||
let result = stateDifference(old[prop], curr[prop]) | ||
if (result) { | ||
newObj[prop] = result | ||
} | ||
|
||
const newObj = {}; | ||
for (let prop in curr) { | ||
const result = stateDifference(old[prop], curr[prop]) | ||
if (result !== undefined) { | ||
newObj[prop] = result; | ||
} | ||
return Object.keys(newObj).length === 0 ? false : newObj | ||
} | ||
|
||
return Object.keys(newObj).length === 0 ? undefined : newObj; | ||
} | ||
|
||
export default stateDifference; | ||
export default stateDifference; |
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
Oops, something went wrong.