Skip to content

Commit

Permalink
fix: caption hiding behind image issue (#1283)
Browse files Browse the repository at this point in the history
* fix: caption hiding behind image issue

* fix: inline styling changed to class

* fix: div cannot be a child of a <p> tag
  • Loading branch information
0xNunana authored Oct 22, 2023
1 parent 9986c1d commit da652c9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
7 changes: 7 additions & 0 deletions src/components/ReadMore/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,10 @@
.read__more__less:hover {
color: rgb(6, 33, 115);
}

.caption_container {
z-Index:1;
background-color: white;
opacity: 0.7;

}
6 changes: 4 additions & 2 deletions src/components/ReadMore/index.jsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import "./index.css";

import React, { useState } from "react";
import { useNavigate, useParams } from "react-router-dom";

Expand All @@ -18,7 +20,7 @@ const ReadMore = ({ children, postId, picCap = false, readMore = true }) => {
: text;

return (
<>
<span className="caption_container">
<Caption caption={captionText} />
{text.length >= 40 && (
<span
Expand All @@ -38,7 +40,7 @@ const ReadMore = ({ children, postId, picCap = false, readMore = true }) => {
{isReadMore ? " ...read more" : " ...show less"}
</span>
)}
</>
</span>
);
};

Expand Down

0 comments on commit da652c9

Please sign in to comment.