Skip to content

Commit e657961

Browse files
committed
fix: tall image clipping in read alongs
1 parent f24e36e commit e657961

File tree

2 files changed

+25
-18
lines changed

2 files changed

+25
-18
lines changed

packages/web-component/src/components/read-along-component/read-along.tsx

Lines changed: 24 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1539,14 +1539,20 @@ export class ReadAlongComponent {
15391539
*
15401540
* @param props
15411541
*/
1542-
Img = (props: { imgURL: string }): Element => {
1542+
Img = (props: { imgURL: string; pageIndex: number }): Element => {
15431543
return (
15441544
<div
15451545
class={
15461546
"image__container page__col__image theme--" +
15471547
this.userPreferences.theme
15481548
}
15491549
>
1550+
{this.mode === "EDIT" && (
1551+
<span id="image-container">
1552+
<this.RemoveImg pageIndex={props.pageIndex} />
1553+
</span>
1554+
)}
1555+
15501556
<img alt={"image"} class="image" src={props.imgURL} />
15511557
</div>
15521558
);
@@ -1609,22 +1615,23 @@ export class ReadAlongComponent {
16091615
const hasImage =
16101616
props.pageIndex in this.images && this.images[props.pageIndex] !== null;
16111617

1612-
return (
1613-
<div class="image__container">
1614-
<span id="image-container">
1615-
{this.mode === "EDIT" && hasImage && (
1616-
<this.RemoveImg pageIndex={props.pageIndex} />
1617-
)}
1618-
{hasImage && <this.Img imgURL={this.images[props.pageIndex]} />}
1619-
</span>
1620-
{this.mode === "EDIT" && !hasImage && (
1621-
<this.ImgPlaceHolder
1622-
pageID={props.pageID}
1623-
pageIndex={props.pageIndex}
1624-
/>
1625-
)}
1626-
</div>
1627-
);
1618+
if (hasImage) {
1619+
return (
1620+
<this.Img
1621+
imgURL={this.images[props.pageIndex]}
1622+
pageIndex={props.pageIndex}
1623+
/>
1624+
);
1625+
}
1626+
1627+
if (this.mode === "EDIT") {
1628+
return (
1629+
<this.ImgPlaceHolder
1630+
pageID={props.pageID}
1631+
pageIndex={props.pageIndex}
1632+
/>
1633+
);
1634+
}
16281635
};
16291636

16301637
/**

packages/web-component/src/scss/_shame.scss

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ p {
5858
}
5959

6060
#img-remover {
61-
margin: 60px;
61+
margin: 0;
6262
position: absolute;
6363
z-index: functions.z("nav");
6464
border-radius: 50px;

0 commit comments

Comments
 (0)