Advertisement
Guest User

Untitled

a guest
Jun 26th, 2016
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.41 KB | None | 0 0
  1. diff --git a/src/components/Entry.js b/src/components/Entry.js
  2. index f7c9114..5d3fea4 100644
  3. --- a/src/components/Entry.js
  4. +++ b/src/components/Entry.js
  5. @@ -1,13 +1,17 @@
  6. import React, { PropTypes } from 'react';
  7. import Markdown from 'react-remarkable';
  8. +import { Link } from 'react-router';
  9.  
  10. const Entry = ({
  11. classes,
  12. + userName,
  13. entryId,
  14. entrySlug,
  15. entryName,
  16. entryContents,
  17. entryDeleted,
  18. + entryByUserId,
  19. + requestSession,
  20. setStatusCode,
  21. setDocumentTitle
  22. }) => {
  23. @@ -34,17 +38,32 @@ const Entry = ({
  24. return (
  25. <div className={classes.Entry}>
  26. <Markdown source={entryContents} />
  27. +
  28. + {entryByUserId === requestSession.userId
  29. + ? (
  30. + <Link
  31. + className={classes.EditButton}
  32. + to={`/${userName}/edit/${entryId}/${entrySlug}`}
  33. + >
  34. + Edit
  35. + </Link>
  36. + )
  37. + : undefined
  38. + }
  39. </div>
  40. );
  41. };
  42.  
  43. Entry.propTypes = {
  44. classes: PropTypes.object.isRequired,
  45. + userName: PropTypes.string.isRequired,
  46. entryId: PropTypes.string.isRequired,
  47. entrySlug: PropTypes.string.isRequired,
  48. entryName: PropTypes.string.isRequired,
  49. entryContents: PropTypes.string.isRequired,
  50. entryDeleted: PropTypes.bool.isRequired,
  51. + entryByUserId: PropTypes.string.isRequired,
  52. + requestSession: PropTypes.object.isRequired,
  53. setStatusCode: PropTypes.func.isRequired,
  54. setDocumentTitle: PropTypes.func.isRequired
  55. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement