error in image loading
Answered
shahriaarrr posted this in #help-forum
Hi. i wrote this component:
and add this component in my home page:
but it's not loaded in my project. howw should i fix this?
//next image
import Image from "next/image";
//next link
import Link from "next/link";
//icons
import { HiArrowRight } from 'react-icons/hi2';
const ProjectsBtn = () => {
return <div className="mx-auto xl:mx-0 ">
<Link
href={'/work'}
className="relative w-[185px] h-[185px] flex justify-center items-center bg-circleStar
bg-cover bg-center bg-no-repeat"
>
<Image
src={'/rounded-text.png'}
width={141}
height={148}
alt=""
className="animate-spin-slow w-full h-full max-w-[141px] max-h-[148px]"
/>
<HiArrowRight className="absolute text-4xl" />
</Link>
</div>;
};
export default ProjectsBtn;and add this component in my home page:
<div className='flex justify-center xl:hidden relative'>
<ProjectsBtn />
</div>but it's not loaded in my project. howw should i fix this?
33 Replies
did you import the component
@joulev did you import the component
yes i import it
but see this.
it's not working
it's not working
what is not working. it is just not there? did you inspect the browser elements, is it there?
look:
this is my home page:
this is my home page:
//next image
import Image from 'next/image';
//components
import ParticlesContainer from "../components/ParticlesContainer";
import ParticlesBtn from "../components/projectsBtn";
import Avatar from "../components/Avatar";
//formar motion
import {motion} from 'framer-motion';
//variations
import {fadeIn} from '../variants';
import ProjectsBtn from '../components/projectsBtn';
const Home = () => {
return <div className='bg-primary/60 h-full'>
{/* text */}
<div className='w-full h-full bg-gradient-to-r from-primary/10 via-black/30 to-black/10'>
<div className='text-center flex-col justify-center xl:pt-40 xl:text-left h-full container mx-auto'>
{/* title */}
<h1 className='h1'>
I'm Shahriar<br /> a{' '} <span className='text-accent'>programmer</span>
</h1>
{/* subtitle */}
<p className='max-w-sm xl:max-w-xl mx-auto xl:mx-0 mb-10 xl:mb-16'>
I'm Shahriar. I love programming and music, coding and creating new things with high motivation.
</p>
{/* btn */}
<div className='flex justify-center xl:hidden relative'>
<ProjectsBtn />
</div>
<motion.div variants={fadeIn('down', 0.4)}>
<ProjectsBtn />
</motion.div>
</div>
</div>
{/* image */}
<div>
image
</div>
</div>;
};
export default Home;hmm. so what is not working
@joulev hmm. so what is not working
i mean this arrow from react icons and circlestart not show in my home page
react-icons then idk, but everything else looks good, do you have a minimal reproduction repository that i can clone and test?
it's not showed in home page
yes i know. but the code looks alright to me, so i need a reproduction repository to clone and debug
@joulev yes i know. but the code looks alright to me, so i need a reproduction repository to clone and debug
it's not on my github. should i send link?
make a minimal reproduction repository and make it a public repo
@joulev make a *minimal* reproduction repository and make it a public repo
i can't make it public before it's done
i don't ask you for your project code, i only ask for a minimal reproduction repository, in other words a minimal amount of code just enough to reproduce the problem
if you cannot do it then you have to wait for someone else to help you because i won't be able to
Barbary Lion
Is it not that it's in an XL:hidden div ?
@Barbary Lion Is it not that it's in an XL:hidden div ?
no
i remove it and nothing change
i remove it and nothing change
Barbary Lion
image in the public directory?
@shahriaarrr Click to see attachment
@joulev @Barbary Lion
Upload the code to github or codesandbox or something similar, I don’t suspect this to be a virus or something but I can’t be too careful
It will be best if you made a GitHub repo and pushed all your code
And also could you send crome debugging ss is thier component rendering??
@▄︻デZÌ·oÌ·rÌ·oÌ· Ì·OÌ·PÌ·â•â•â”一 It will be best if you made a GitHub repo and pushed all your code
I can't set it in github now. Is there any way to send you code?
Setup codesandbox then
ok
i'm run it again and this logo worked now
Answer
thanks for your help