adrianhajdin / project_crowdfunding

With a stunning design, connected to the blockchain, metamask pairing, interaction with smart contracts, sending Ethereum through the blockchain network, and writing solidity code.
https://jsmastery.pro
680 stars 372 forks source link

sidbar #76

Open monaldmuck opened 8 months ago

monaldmuck commented 8 months ago

import React, { useState } from 'react'; import { Link, useNavigate } from 'react-router-dom';

import { logo, sun } from '../assets'; import { navlinks } from '../constants';

const Icon = ({ styles, name, imgUrl, isActive, disabled, handleClick }) => ( <div className={w-[48px] h-[48px] rounded-[10px] ${isActive && isActive === name && 'bg-[#2c2f32]'} flex justify-center items-center ${!disabled && 'cursor-pointer'} ${styles}} onClick={handleClick}> {!isActive ? (

fund_logo
) : (
  <img src={imgUrl} alt="fund_logo" className={`w-1/2 h-1/2 ${isActive !== name && 'grayscale'}`} />
)}

)

const Sidebar = () => { const navigate = useNavigate(); const [isActive, setIsActive] = useState('dashboard');

return (

{navlinks.map((link) => ( { if(!link.disabled) { setIsActive(link.name); navigate(link.link); } }} /> ))}

) }

export default Sidebar

this is my sidebar code and the icons are jumbled and do not have a background \