From 64d354dbe19ce4b7e4cd014f03fa32ba6df5b0a1 Mon Sep 17 00:00:00 2001 From: Damian Mullins <89059+DamianMullins@users.noreply.github.com> Date: Sat, 9 Mar 2019 22:58:39 +0000 Subject: [PATCH] v1.5.0. (#4) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * v1.5.0 — Coin images animate in once loaded. * v1.5.0 — Details only visible when logged in. * v1.5.0 — Hide avatar. * v1.5.0 — Toggle menu when selecting a filter. * v1.5.0 — Netlify status on readme. * v1.5.0 — Updates. * v1.5.0 — Fixed unit test. --- README.md | 2 +- package.json | 2 +- src/components/Coin.js | 54 ++++++++++++------- src/components/Details.js | 6 +-- .../__tests__/__snapshots__/Coin.test.js.snap | 2 +- src/containers/DetailsContainer.js | 1 + src/store/actions/filters.js | 3 ++ src/styles/Coin.module.scss | 6 +++ src/styles/Header.module.scss | 1 + yarn.lock | 22 ++++---- 10 files changed, 64 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index a98aded..2131f2e 100644 --- a/README.md +++ b/README.md @@ -10,6 +10,6 @@ --- -[![Build Status](https://travis-ci.org/DamianMullins/Coinsly.svg)](https://travis-ci.org/DamianMullins/Coinsly) +[![Netlify Status](https://api.netlify.com/api/v1/badges/0510b39f-79ed-45cf-88c6-ab00800e97be/deploy-status)](https://app.netlify.com/sites/coinsly/deploys) [![Coverage Status](https://coveralls.io/repos/github/DamianMullins/Coinsly/badge.svg)](https://coveralls.io/github/DamianMullins/Coinsly) [![Known Vulnerabilities](https://snyk.io/test/github/DamianMullins/Coinsly/badge.svg)](https://snyk.io/test/github/DamianMullins/Coinsly) diff --git a/package.json b/package.json index e9dc4e6..e928164 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "coinsly", - "version": "1.4.0", + "version": "1.5.0", "description": "", "main": "src/index.js", "keywords": [ diff --git a/src/components/Coin.js b/src/components/Coin.js index 5e10796..06b1a43 100644 --- a/src/components/Coin.js +++ b/src/components/Coin.js @@ -1,26 +1,44 @@ -import React from 'react'; +import React, { Component } from 'react'; import PropTypes from 'prop-types'; import styles from '../styles/Coin.module.scss'; import tick from '../assets/tick.svg'; -const Coin = ({ coin, setOwnedValue }) => ( -
  • - -
  • -); +class Coin extends Component { + state = { + loaded: false + }; + + onImageLoaded = () => { + this.setState({ loaded: true }); + } + + render () { + const { coin, setOwnedValue } = this.props; + + return ( +
  • + +
  • + ) + } +} Coin.propTypes = { coin: PropTypes.object.isRequired, diff --git a/src/components/Details.js b/src/components/Details.js index 2d35ff8..ab40e74 100644 --- a/src/components/Details.js +++ b/src/components/Details.js @@ -5,8 +5,8 @@ import coinHelper from '../lib/coinHelper'; import Totals from './Totals'; import styles from '../styles/Totals.module.scss'; -const Details = ({ user, denomination, coins }) => - user && ( +const Details = ({ userAuthenticated, denomination, coins }) => + userAuthenticated && (
    {({ total, owned, percentage }) => ( @@ -29,7 +29,7 @@ const Details = ({ user, denomination, coins }) => ); Details.propTypes = { - user: PropTypes.object.isRequired, + userAuthenticated: PropTypes.bool.isRequired, coins: PropTypes.array.isRequired, denomination: PropTypes.string.isRequired }; diff --git a/src/components/__tests__/__snapshots__/Coin.test.js.snap b/src/components/__tests__/__snapshots__/Coin.test.js.snap index c79f521..4838fab 100644 --- a/src/components/__tests__/__snapshots__/Coin.test.js.snap +++ b/src/components/__tests__/__snapshots__/Coin.test.js.snap @@ -2,7 +2,7 @@ exports[`coin markup is correct 1`] = `