diff --git a/src/components/projects/Project.jsx b/src/components/projects/Project.jsx index 406464a..b3dff3e 100644 --- a/src/components/projects/Project.jsx +++ b/src/components/projects/Project.jsx @@ -21,6 +21,7 @@ import { timeSinceBlock } from '../../utils/dates' import { getAmountsPledged } from '../../utils/pledges' import { getFiles } from '../../utils/ipfs' import { getImageType } from '../../utils/images' +import { getProjectManifest } from '../../utils/project' import { useProjectData } from './hooks' const ROOT_PATH = '/root/' @@ -142,10 +143,6 @@ async function _getProjectAssets(hash, setState){ .catch(console.log) } -const getProjectManifest = assets => { - return assets ? JSON.parse(assets.find(a => a.name.toLowerCase() === 'manifest.json').content) : null -} - const formatMedia = content => { const type = 'video/mp4' const blob = new Blob([content], {type}) diff --git a/src/utils/project.js b/src/utils/project.js index 9f90043..142b061 100644 --- a/src/utils/project.js +++ b/src/utils/project.js @@ -14,7 +14,7 @@ const isManifest = asset => { const name = getName(asset) return name.toLowerCase() === 'manifest.json' } -const getProjectManifest = assets => { +export const getProjectManifest = assets => { return assets ? JSON.parse(assets.find(isManifest).content) : null }