Skip to content

Instantly share code, notes, and snippets.

@xthecapx
Created June 17, 2019 17:49
Show Gist options
  • Save xthecapx/3cd3c8f00f72c465a3aace0e67c7c1c6 to your computer and use it in GitHub Desktop.
Save xthecapx/3cd3c8f00f72c465a3aace0e67c7c1c6 to your computer and use it in GitHub Desktop.

Revisions

  1. xthecapx revised this gist Jun 17, 2019. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion ProductAlerts.jsx
    Original file line number Diff line number Diff line change
    @@ -9,4 +9,6 @@ const ProductAlerts = ({ product }) => {
    }

    return <div className="product-alerts">{productAlerts}</div>
    };
    };

    export default ProductAlerts;
  2. xthecapx created this gist Jun 17, 2019.
    12 changes: 12 additions & 0 deletions ProductAlerts.jsx
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,12 @@
    import React from 'react';
    import {products} from './products';

    const ProductAlerts = ({ product }) => {
    let productAlerts;

    if (product.price > 700) {
    productAlerts = <p><button>Notify Me</button></p>;
    }

    return <div className="product-alerts">{productAlerts}</div>
    };