Skip to content

Commit

Permalink
H #2546 do not show image in verification when there is none
Browse files Browse the repository at this point in the history
  • Loading branch information
RamRamez committed Sep 25, 2021
1 parent 5ed5652 commit d423548
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 14 deletions.
16 changes: 9 additions & 7 deletions src/components/views/verification/ConfirmProject.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,15 @@ import DescriptionRender from '../../DescriptionRender';
const ConfirmProject = ({ handleNextStep, project, reportIssue, formIsValid, isSaving }) => {
return (
<div>
<img
className="w-100"
height={150}
src={project.image}
alt={project.title}
style={{ objectFit: 'cover' }}
/>
{project.image && (
<img
className="w-100"
height={150}
src={project.image}
alt={project.title}
style={{ objectFit: 'cover' }}
/>
)}
<div className="row p-4">
<div className="col-md-4">
<div className="custom-title">Confirm your Project to make it traceable</div>
Expand Down
16 changes: 9 additions & 7 deletions src/components/views/verification/Congratulations.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,15 @@ const Congratulations = ({ campaignSlug, project }) => {

return (
<div>
<img
className="w-100"
height={150}
src={project.image}
alt={project.title}
style={{ objectFit: 'cover' }}
/>
{project.image && (
<img
className="w-100"
height={150}
src={project.image}
alt={project.title}
style={{ objectFit: 'cover' }}
/>
)}
<div className="text-left p-5">
<div>
<strong>Title: </strong>
Expand Down
2 changes: 2 additions & 0 deletions src/components/views/verification/Main.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ const Verification = props => {
},
})
.then(_project => {
// Default project images in IO are saved as numbers, we remove them
if (/^\d+$/.test(_project.image)) _project.image = '';
setProject(_project);
setStep(step + 1);
})
Expand Down

0 comments on commit d423548

Please sign in to comment.