Skip to content

Commit

Permalink
Fixed Placeholder and blog bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Ayushmaanagarwal1211 committed Jan 13, 2025
1 parent c278b33 commit 306d841
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions website3.0/components/blogpage/BlogPost.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ function BlogPost() {
setReply(arr)
setComments(data.comments || []);
updateTotalReactionCount(data.reactionList);
let userid=JSON.parse(localStorage.getItem('finalUser'))._id
let userid=JSON.parse(localStorage.getItem('finalUser'))?._id || ""
data.comments.map((res)=>{
let ans=false
res.likeusers.map(r=>{
Expand Down Expand Up @@ -892,7 +892,7 @@ return formattedDate
let [modalIndex,setModalIndex]=useState(false)
function handleError(){

document.getElementById("image-section").src='https://via.placeholder.com/600x400.png?text=No+Image+Available'
document.getElementById("image-section").src='https://dummyimage.com/600x300'
}
return (
<>
Expand Down
2 changes: 1 addition & 1 deletion website3.0/pages/AdminPanel.js
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const AdminPanel = ({authKey}) => {
className="w-10 h-10 rounded-full ml-4"
/> */}
<Image
src="https://via.placeholder.com/40" // URL to your image
src="https://dummyimage.com/600x300" // URL to your image
alt="Admin Profile"
layout="fill" // Fills the container
objectFit="cover" // Ensures the image covers the container while preserving aspect ratio
Expand Down
2 changes: 1 addition & 1 deletion website3.0/pages/BlogPage.js
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@ useEffect(()=>{
const handleImageError = (e) => {
const src = e.target.src;
e.target.onerror = null;
e.target.src = "https://via.placeholder.com/600x400.png?text=No+Image+Available"
e.target.src = "https://dummyimage.com/600x300"

};

Expand Down

0 comments on commit 306d841

Please sign in to comment.