As a user, on the home page there should be some filter buttons.
AC
WHEN the page loads
THEN I should see a LEFT and a RIGHT button
AND clicking on one of those buttons should only show socks seeking either left or right pairs.
WHEN the page loads
THEN I should see a DIRTY and a clean button
AND clicking on one of those buttons should only show socks that are either dirty or clean.
WHEN the page loads
THEN I should see a COLOR button
AND clicking on that button should only show socks that match the color of the authenticatedUser.
Dev Notes
Add all 5 buttons to index.html
add eventlistener on 'click' to LEFT and RIGHT buttons that calls a function called directionFilter
add eventlistener on 'click' to DIRTY and clean buttons that calls a function called dirtyFilter
add eventlistener on 'click' to COLOR button that calls a function called colorFilter
directionFilter function should loop over all socks and make a new array called selectedSocks that contains only the socks that have wantsLeft status that matches button clicked. After looping this function should pass the array to the sockBuilder function
dirtyFilter function should loop over all socks and make a new array called selectedSocks that contains only the socks that have isDirty status that matches button clicked. After looping this function should pass the array to the sockBuilder function
colorFilter function should loop over all socks and make a new array called selectedSocks that contains only the socks that have the color status the color of the authenticatedUser. After looping this function should pass the array to the sockBuilder function
User Story
As a user, on the home page there should be some filter buttons.
AC
WHEN the page loads THEN I should see a
LEFT
and aRIGHT
button AND clicking on one of those buttons should only show socks seeking either left or right pairs.WHEN the page loads THEN I should see a
DIRTY
and aclean
button AND clicking on one of those buttons should only show socks that are either dirty or clean.WHEN the page loads THEN I should see a
COLOR
button AND clicking on that button should only show socks that match the color of theauthenticatedUser
.Dev Notes
LEFT
andRIGHT
buttons that calls a function calleddirectionFilter
DIRTY
andclean
buttons that calls a function calleddirtyFilter
COLOR
button that calls a function calledcolorFilter
directionFilter
function should loop over all socks and make a new array called selectedSocks that contains only the socks that havewantsLeft
status that matches button clicked. After looping this function should pass the array to thesockBuilder
functiondirtyFilter
function should loop over all socks and make a new array called selectedSocks that contains only the socks that haveisDirty
status that matches button clicked. After looping this function should pass the array to thesockBuilder
functioncolorFilter
function should loop over all socks and make a new array called selectedSocks that contains only the socks that have thecolor
status the color of theauthenticatedUser
. After looping this function should pass the array to thesockBuilder
function