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

How do I make sure a person cannot donate zero 0r negative amount. #58

Closed kihiuFrank closed 1 year ago

kihiuFrank commented 1 year ago

I need help ensuring a person cannot donate anything <=0 in the snippet below from CampaignDetails.jsx.

<input
                type="number"
                placeholder="ETH 0.1"
                step="0.01"
                className="w-full py-[10px] sm:px-[20px] px-[15px] outline-none border-[1px] border-[#3a3a43] bg-transparent font-epilogue text-white text-[18px] leading-[30px] placeholder:text-[#4b5264] rounded-[10px]"
                value={amount }
                onChange={(e) => setAmount(e.target.value)}
              />

I also need arrow pointing downwards to deactivate once a user hits zero.

Screenshot 2023-07-10 at 08 12 48