<ButtonCard heading={'Spark Challenge'} description={ 'A Challenge for students to…
- User
<ButtonCard heading={'Spark Challenge'} description={ 'A Challenge for students to produce unique, novel products and services that mitigate the detrimental impact of Climate Change. ' } bgColor={'#262626'} headingColor={'#1f68d6'} href={'/challenge'} buttonColor={'#1f68d6'} /> why is it when i do it like this, on the site i see the small 'no image' symbol, i dont want an image in this card. shall i send you the full buttoncard component?
- Assistant
The issue you're encountering with the 'no image' symbol likely stems from how the
ButtonCardcomponent is designed. If the component expects an image prop and it's not provided, it might default to displaying a placeholder image or a 'no image' icon.To resolve this issue, you may need to modify the
ButtonCardcomponent itself to handle cases where no image is specified. Ideally, the component should check if an image prop is provided and only render the image section if it exists. If you want to share the fullButtonCardcomponent code, I can help you identify where to make this change.Here is a general example of how you might modify the component to handle the image prop gracefully:
jsx - User
return ( <Card h={cardHeight} w={width} bg={bgColor} padding={'sm'} component={Link} href={href} radius={radius} withBorder style={{ transform: isHovered && !isMobile ? 'scale(1.1) ' : 'scale(1)', // Scale card on hover transition: 'transform 0.3s ease', zIndex: isHovered && !isMobile ? 1 : 'auto', // Ensure hovered card is on top }} onMouseEnter={() => !isMobile && setIsHovered(true)} onMouseLeave={() => !isMobile && setIsHovered(false)} > <Card.Section> <Image component={NextImage} height={height} width={width} src={imageSrc} alt={'My image'} fit={'contain'} /> </Card.Section>
code<Text c={headingColor} fw={headingWeight} fz={headingSize} px={'md'} mt={'md'} > {heading} </Text> <Text c={textColor} fw={700} size={textSize} mt={'md'} px={'md'} > {description} </Text> <Button color={buttonColor} radius={'xl'} mt={'auto'} ml={'auto'} > <Text /*td={'underline'}*/ fw={900} fz={'sm'} c={'#262626'} > Learn More </Text> </Button> </Card> - Assistant