Open Davison82 opened 1 year ago
@Davison82 Hi, the CreateCampaign
button is written at Navbar
<div className="flex mx-4">
<CustomButton
btnType="button"
title={address ? "Create a Campaign" : "Connect"}
styles={address ? "bg-[#1dc071]" : "bg-[#8c6dfd]"}
handleClick={() => {
if (address) {
navigate("create_campaign");
setToggleDrawer((prev) => !prev);
} else {
connect();
}
}}
/>
</div>
StateContext.Provider
is passing connect
function.
You can refer this : https://github.com/adrianhajdin/project_crowdfunding/blob/a554d7eaeefe1f6f2b73c8ecd837b6805aaed4b7/client/src/components/Navbar.jsx#L81
Hi Pradeep Thank you for replying to my question. I have checked the code in the Navbar as you suggested and it's good but after importing { UseStateContext } and const { connect, address } = useStateContext(); nothing happnes the button is dead. Is there a package that I need to download?
Best RegardsJohn On Wednesday, 1 March 2023 at 13:35:26 GMT, Pradeep A @.***> wrote:
@Davison82 Hi, the CreateCampaign button is written at Navbar
StateContext.Provider is passing connect function. You can refer this : https://github.com/adrianhajdin/project_crowdfunding/blob/a554d7eaeefe1f6f2b73c8ecd837b6805aaed4b7/client/src/components/Navbar.jsx#L81
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you were mentioned.Message ID: @.***>
@Davison82 No additional package was installed.
Can you try this code snipped inside handleClick
trigger
handleClick={() => { if (address) navigate("create_campaign"); else connect(); }}
Thank you this is now functioning.
Now, I'm having issues with the Campaign Details page.
<CountBox title={Raised of ${state.target}
} value={state.amountCollected} />
It won't display the amount donated?
Hi All
I'm having trouble with the StateContext.Provider return function. The "Create a campaign" button which appears in the tutorial isn't there.
}
export const useStateContext = () => useContext (StateContext);