Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolves Issue #13 (#35) - View Purchase Details #56

Merged
merged 5 commits into from
Mar 13, 2020

Conversation

mjhcodes
Copy link
Contributor

@mjhcodes mjhcodes commented Mar 8, 2020

Issue: #35

Tasks:

The main purpose of the issue was to create a way for the user to view the details of their purchase to better understand their purchase patterns. We opted to use a modal to display the item details, which is opened by clicking a button, which is found alongside each item on the list.

Actions:

  • Imported the modal, which had been created as part of a previous issue
  • Created a toggle state and function for opening and closing the modal
  • Created an initialized state for the modal details, as this is rendered at load time and would return an error otherwise.
  • Created the hideDetails and showDetails functions, with the latter also inserting the details of the item into state
  • Created the handleDetails function, which displays the four data points requested as part of the issue inside of the modal, if all four are available; the name and number of purchases are always displayed at a minimum
  • Created a function to convert the seconds returned by the date purchased value into a more readable date format and incorporated this inside the modal
  • Created a button to allow the opening of the modal when clicked
  • Placed the modal inside the return, to be rendered if the isViewDetailOpen value is set to true

Notes:

PR appears to mistakenly also include the changes made as part of a previous issue

Screenshots:

EXAMPLE 1 - VIEW DETAILS BUTTON
Screen Shot 2020-03-07 at 4 38 58 PM

EXAMPLE 2 - LIMITED DETAILS MODAL
Screen Shot 2020-03-07 at 4 39 48 PM

EXAMPLE 3 - FULL DETAILS MODAL
Screen Shot 2020-03-07 at 4 39 14 PM

Copy link

@rmorabia rmorabia left a comment

Choose a reason for hiding this comment

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

LGTM.

src/App.js Outdated
@@ -8,6 +8,8 @@ import getToken from "./lib/token";
import Form from "./Form/Form";
import * as firebase from "./lib/firebase";

// heck spiky rake

Copy link

Choose a reason for hiding this comment

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

Remove unnecessary comments!

Copy link
Contributor

Choose a reason for hiding this comment

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

LOL that was mine and I'm so sorry I keep forgetting about it and it never dies

Copy link
Contributor

@jcwesley93 jcwesley93 left a comment

Choose a reason for hiding this comment

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

I think that everything here looks good code wise. This is probably my favorite PR description thus far! I liked your use of screenshots and the detailed description. I was able to navigate the code changes easily because of this. Great work!

import { NavLink } from "react-router-dom";
import "firebase/firestore";
import * as firebase from "../lib/firebase";
import classes from "./List.module.css";
import Modal from "../Modal/Modal";
Copy link
Contributor

Choose a reason for hiding this comment

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

I really like that you all used Modal - I think it makes for a cleaner UI experience.

@RachaelSkye
Copy link
Contributor

Everything looks great and I definitely like using the modal to view details. Also, this has definitely been a lesson in PR requests! Thanks for being so thorough!

Copy link
Contributor

@msholty-fd msholty-fd left a comment

Choose a reason for hiding this comment

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

Excellent! 🏅 :shipit:

@haleyelder haleyelder merged commit a1a6984 into master Mar 13, 2020
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.

6 participants