Skip to content

Conversation

@LuisB1717
Copy link
Collaborator

image

products,
addProduct,
deleteProduct,
customers,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Customer on the global store is not required. The data should be only in the dropdown component or where it is called. In the global store we should have only the selected customer, but I think that's defined in another ticket.

</button>
</section>
<>
<section className="Dropdown">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Dropdown component should receive a generic array of items, don't get specific logic inside the component. You can use the dropdown branch as a guide.

In this component you are handling all related to customers only, you may need to rename this component (to CustomerSelector or CustomerPicker maybe) and use the Dropdown component inside of it. Do not forget that the goal of the Dropdown component is to handle any array of items to be able to select one of them.

const [filteredCustomers, setFilteredCustomers] = useState(customers)

async function setCustomersToStorage() {
const data = await getCustomers()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review this logic because the data is empty at the first load (try it in a private window). I will check this once the others comments are solved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants