digitalhippo
digitalhippo copied to clipboard
Fix some bugs and add some functionalities
Add to Cart Once: To prevent having the same product multiple times. I implement this functionality to verify if the product is in the cart. If not, it will be added and also will show a nice toast from Shadcn. However, if the product is already in the cart, it won't be added and will show a toast. I liked Shadcn Toast component better but you can change. I could've done it in the use-cart hook as well, but I did it directly on the component. I wonder what would be the practice on this matter.
Navbar Fixes: Cart component was hidden on Mobile screens. Putting it one div benea… …th solved the issue.
Sign In: Changing the position router.refresh will successfully reload the page and hid… …e the (Sign In & Sign Up) buttons.