Skip to content

avaloninnovations/interview-login-modal

Repository files navigation

Scriptive Interview Task: Login Modal

Task

You are given a semi-working implementation of a login component, pair-programming with your interviewer you will need to complete some of the following tasks:

  1. Make sure clicking the "Login" button will show the modal.

  2. Make sure clicking the "Close" button will hide the modal.

  3. Clicking anywhere outside the modal should close it.

  4. Make click-outside logic into a reuseable hook useClickOutside that can be used in other components.

Bonus Tasks:

  • When modal is open, focus should be on the first input field. When modal is closed, focus should return to the "Login" button.

  • Move the modal control logic into a Context and add another button that will open the modal.

Note: not all tasks need to be completed, the goal is to see how you approach the problem and how you work with the interviewer.