load pictures from the api server

This commit is contained in:
Delucse
2020-11-30 13:44:05 +01:00
parent a2c571c1e7
commit c8f01f8273
6 changed files with 53 additions and 31 deletions
+2 -2
View File
@@ -22,11 +22,11 @@ class Instruction extends Component {
{isHardware ?
<Hardware picture={step.hardware} /> : null}
{areRequirements > 0 ?
<Requirement tutorialIds={step.requirements} /> : null}
<Requirement requirements={step.requirements} /> : null}
{step.media ?
step.media.picture ?
<div style={{ display: 'flex', justifyContent: 'center', marginBottom: '5px' }}>
<img src={`/media/tutorial/${step.media.picture}`} alt='' style={{ maxHeight: '40vH', maxWidth: '100%' }} />
<img src={`${process.env.REACT_APP_BLOCKLY_API}/media/${step.media.picture.path}`} alt='' style={{ maxHeight: '40vH', maxWidth: '100%' }} />
</div>
: step.media.youtube ?
/*16:9; width: 800px; height: width/16*9=450px*/