Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

H 2546 do not show image in verification when there is none #2547

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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