This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from 'react'; | |
import PropTypes from 'prop-types'; | |
class ExampleWebComponent extends React.Component { | |
render() { | |
return ( | |
<div className="w100"> | |
<div className="menuTitleWrap"> | |
<img src={this.props.url} className="shadowImage" alt="" /> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { connect } from "react-redux"; | |
import { fetchProducts } from "./actions"; | |
import ProductsList from "./ProductsList"; | |
class Products extends React.Component { | |
componentWillMount() { | |
const { dispatch } = this.props; | |
dispatch(fetchProducts()); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import config from "./config"; | |
export const requestProducts = () => ({ | |
type: "REQUEST_PRODUCTS" | |
}); | |
export const receiveProducts = products => ({ | |
type: "RECEIVE_PRODUCTS", | |
products | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { Component } from "react"; | |
import config from "./config"; | |
import CategoriesList from "./CategoriesList"; | |
class Categories extends Component { | |
constructor(props) { | |
super(props); | |
this.state = { | |
categories: [] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStore, combineReducers, applyMiddleware } from "redux"; | |
import thunk from "redux-thunk"; | |
import categories from "./views/Categories/reducer"; | |
import products from "./views/Products/reducer"; | |
const rootReducer = combineReducers({ categories, products }); | |
const defaultState = {}; | |
const store = createStore(rootReducer, defaultState, applyMiddleware(thunk)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html manifest="" <?php language_attributes(); ?>> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, | |
maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> | |
<!-- load other meta tags here --> | |
<title><?php echo get_bloginfo("name");?></title> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React from "react"; | |
import { connect } from "react-redux"; | |
import ProductCard from "./ProductCard"; | |
class ProductsList extends React.Component { | |
render() { | |
const list = this.props.products.map(element => ( | |
<ProductCard | |
key={element.id} | |
src={element.images[0].src} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { combineReducers } from "redux"; | |
const productsReducer = (state = [], action) => { | |
switch (action.type) { | |
case "REQUEST_PRODUCTS": | |
return state; | |
case "RECEIVE_PRODUCTS": | |
return action.products; | |
default: | |
return state; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script> | |
if('serviceWorker' in navigator) { | |
navigator.serviceWorker | |
.register('/sw.js') | |
.then(function() { console.log("Service Worker Registered"); }); | |
} | |
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE HTML> | |
<html manifest="" <?php language_attributes(); ?>> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" /> | |
<meta name="apple-mobile-web-app-capable" content="yes" /> | |
<meta name="apple-touch-fullscreen" content="yes" /> | |
<meta name="apple-mobile-web-app-status-bar-style" content="black" /> | |
<meta name="mobile-web-app-capable" content="yes" /> |