This is a draft for a ground up rebuild with sound architecture using Redux and TDD so it can be more easily maintained and extended in the future. The current, visual design can be maintained.
Each of these are set with the next set of developers coming in behind us in mind.
- The app follows conventions we've covered in class and that are used at Deere
- Improve the app with bug fixes
- There is a clear architecture so when it is reviewed by the next group they see a cohesive code base.
- If you examine the current code, it's really messy. By working together and taking the same approach we can circumvent this.
- Improve the app with additional features
- Display
gifs- Currently they are displayed as a static images due to not accounting for
gifdurationgifscan be extracted fromdata.preview.variants.gif.source.url
- Currently they are displayed as a static images due to not accounting for
- Scale images appropriately,
- Low resolution images should be
fit-centerand high resolution images should bescaled-center
- Low resolution images should be
- Like button
- Previous button
- Share to Slack button
images: [],- This is an
arrayofobjectscontaining an imageurl,id, andtitle:{url: 'https://dafa', id: 1, title: 'some title', gif: true}
- This is an
current: 0- This is the current
indexofimagesbeing displayed
- This is the current
likes: {}- This is a
tableofidtonumber_of_likes, this is important to store independently because theimages arraywill be wiped and replaced on a timer.{ [id]: 0, [id]: 2 }
- This is a
nsfw: {}- This is another
table, except is will be a mapping of flagged posts:{ [id]: true, [id]: false }
- This is another
gifDuration: {}- This is another
table, if animageis agifthen it's duration will be stored here:{ [id]: 1021, [id]: 111 } - If an image is not a gif, perform a lookup in this table will return
undefined
- This is another
Appdispatch: yes,- This is the root level component, when it is mounted, given an interval, it should retrieve top posts from reddit.
- The retrieved posts should overwrite the
imagesarray in redux store.
- The retrieved posts should overwrite the
- This is the root level component, when it is mounted, given an interval, it should retrieve top posts from reddit.
Displayprops: images, current, gifDuration,dispatch: yes- This component handles actually displaying the images.
Displaywill always display the image on thecurrentindex- Given an interval, once the component has mounted, it should
dispatchto update thecurrentindex in the store- This should account for
gifduration- This requires a helper function:
getGifDuration
- This requires a helper function:
- This should account for
- This component handles actually displaying the images.
Next Buttonprops:,- This component will update
currentin the redux store with the next image inimages
- This component will update
Prev Button,- This component will update
currentin the redux store with the next image inimages
- This component will update
NSFW Button,- This component will flag the
current indexby updating thensfw tablein the redux store
- This component will flag the
Fullscreen Button,- This component will make the browser window full screen
Like Button,- This component will increment the
current image idinlikesin the redux store, it will also display the number of likes next to the button.
- This component will increment the
Slack Share,- This component will utilize the Slack Web-hook to post the
imageto one of our Slack channels - Create a new channel on Slack
- This component will utilize the Slack Web-hook to post the