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' | |
import {Card, CardImg, CardBlock, CardTitle, CardText, Button} from 'reactstrap'; | |
const ProductCard = ({elem, cartIds, quantity, addItemToCart, history}) => ( | |
<Card className="m-1" style={{width: '18rem'}} | |
onClick={() => { | |
history.push(`/products/${elem.id}`) | |
}}> |
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
/* eslint no-console: 0 */ | |
import React, {Component} from "react"; | |
import PropTypes from 'prop-types' | |
import {connect} from 'react-redux'; | |
import { | |
Card, Button, CardImg, CardTitle, CardText, | |
CardBlock, Row, Col, Input, InputGroup, InputGroupAddon | |
} from 'reactstrap'; | |
import InputRange from 'react-input-range'; |
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 axios from 'axios'; | |
import { SET_FILTER_TERM, SET_FILTER_PRICE, ADD_API_DATA } from './actions'; | |
export function setFilterTerm(filterTerm) { | |
return { type: SET_FILTER_TERM, payload: filterTerm }; | |
} | |
export function setFilterPrice(filterPrice) { | |
return { type: SET_FILTER_PRICE, payload: filterPrice }; | |
} |
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
/* eslint no-console: 0 */ | |
import React, {Component} from "react"; | |
import PropTypes from 'prop-types' | |
import {connect} from 'react-redux'; | |
import { | |
Card, Button, CardImg, CardTitle, CardText, | |
CardBlock, Row, Col, InputGroup, InputGroupAddon | |
} from 'reactstrap'; | |
import InputRange from 'react-input-range'; |
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
<CardDeck> | |
array.slice(0, 3).map(function mapProductCards(elem, index) { | |
return ( | |
<Card className="m-1" style={{width: '18rem'}} key={elem.id}> | |
<CardImg top width="100%" src={`/public/img/${elem.image}`} /> | |
<CardBlock> | |
<CardTitle>{elem.name}</CardTitle> | |
<CardText>{elem.price}</CardText> | |
<CardText>isAvailable</CardText> | |
<CardText>{elem.manufacturer}</CardText> |
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
/* eslint no-console: 0 */ | |
import React, {Component} from "react"; | |
import PropTypes from 'prop-types' | |
import {connect} from 'react-redux'; | |
import { | |
Card, Button, CardImg, CardTitle, CardText, | |
CardBlock, Row, Col, InputGroup, InputGroupAddon | |
} from 'reactstrap'; | |
import {setFilterTerm, getAPIDetails} from '../redux/actionCreators'; |
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, { PropTypes } from 'react'; | |
import { Route, Redirect } from 'react-router-dom'; | |
const Authenticated = ({ loggingIn, authenticated, component, ...rest }) => ( | |
<Route {...rest} render={(props) => { | |
if (loggingIn) return <div></div>; | |
return authenticated ? | |
(React.createElement(component, { ...props, loggingIn, authenticated })) : | |
(<Redirect to="/login" />); | |
}} /> |
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
var board = ['x', 'o', 'e', 'e', 'o', 'e', 'e', 'e', 'e']; | |
var signPlayer = 'o'; | |
var signAI = (signPlayer === 'x') ? 'o' : 'x'; | |
game = { | |
over: function(board) { | |
for (var i = 0; i < board.length; i += 3) { | |
if (board[i] === board[i + 1] && board[i + 1] === board[i + 2]) { | |
return board[i] !== 'e' ? board[i] : false; | |
} |
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
var inputItem = 'o'; | |
var board = [null , null , null , null , 'o', null , null , null , null ]; | |
var sign = { | |
max: inputItem === "o" ? "x" : "o", | |
min: inputItem === "x" ? "x" : "o" | |
}; | |
function generateTable(board, sign) { | |
var testBoard = [], | |
nextBoard; |
NewerOlder