#TID:
Today, I worked exclusively on refactoring my e-commerce-site project(based on the content of the Korean Sinabro JavaScript video course. Progress included the following:
- Implemented functions to reduce repetitive lines of code that achieved similar outcomes (e.g. incorporating
getProductHTML
to render product HTML components across both the cart-layer and main-page-layer. - Fixed the bug on the e-commerce site - now, updating the item-count on the Cart-layer also triggers an update to the said item-count on the main e-commerce site
- Learned that I can conditionally enable and/or disable a button by including ternary condition within the HTML element, like the example below:
<button class="btn-removeItem type="button" `${
count === 0 ? "disabled" : ""}`
">Remove Item</button>