Skip to content

Commit

Permalink
Merge pull request #278 from ajinkyapandetekdi/19-feb-test-rig-1.1
Browse files Browse the repository at this point in the history
issuid #0000 added storymode in test-rig
  • Loading branch information
gouravmore authored Feb 21, 2025
2 parents c4b0d58 + 6cb48fe commit 2875a01
Show file tree
Hide file tree
Showing 4 changed files with 189 additions and 92 deletions.
2 changes: 1 addition & 1 deletion src/components/DiscoverSentance/DiscoverSentance.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -357,7 +357,7 @@ const SpeakSentenceComponent = () => {
storyLine,
handleNext,
type: questions[currentQuestion]?.contentType,
image: elephant,
// image: elephant,
enableNext,
showTimer: false,
points,
Expand Down
19 changes: 19 additions & 0 deletions src/components/Mechanism/WordsOrImage.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,25 @@ const WordsOrImage = ({
pointerEvents: disableScreen ? "none" : "initial",
}}
>
{image && (
<Box sx={{ display: "flex", justifyContent: "center" }}>
<img
src={image}
onError={(e) => {
e.target.style.display = "none"; // Hide the image if it fails to load
}}
style={{
width: "100%", // Image will take full width of the parent container
maxWidth: "500px", // Limit the width to 500px
height: "auto", // Maintain aspect ratio
maxHeight: "200px", // Cap the height at 200px
marginBottom: "40px",
objectFit: "contain", // Ensures the image fits well within the dimensions
}}
alt="Responsive content" // Adding alt text for accessibility
/>
</Box>
)}
{type === "image" ? (
<Box sx={{ display: "flex", justifyContent: "center" }}>
<img
Expand Down
20 changes: 17 additions & 3 deletions src/utils/constants.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 2875a01

Please sign in to comment.