text
stringlengths
7
3.69M
/* * grunt-topojson * https://github.com/mark.dimarco/grunt-topojson * * Copyright (c) 2014 Mark DiMarco * Licensed under the MIT license. */ 'use strict'; var topojson = require('topojson'); var _ = require('underscore'); module.exports = function(grunt) { // Please see the Grunt documentation for more info...
function getTotalX(one,two) { let fs = one.reduce((a,b) => Math.max(a, b)) let sc = two.reduce((a,b) => Math.min(a,b)) let middle = Array.apply(null, Array(sc)).map((a,b) => b+1).filter(i => i % fs == 0) return middle } // console.log(getTotalX([2],[20,30,12])) // should yield 1 // conso...
var queue = exports.q || exports; // if string syntax, setup as function if (exports.hasOwnProperty('q')) { // if string syntax exports = window['@@name'] = function () { var args = Array.prototype.slice.call(arguments); var method = args.shift(); if (exports.hasOwnProperty(method)) { ...
import Store from '../store'; import Dispatcher from '../dispatcher'; import symbols from '../symbols'; /** * A Store is a singleton whose job is to contain data and notify changes * to listeners. * * We'll usually use EventEmitter to manage subscriptions and event notifications * but that code is best kept in o...
/** * Javascript for animal page */ {aBreedsVar} $(document).ready(function() { $('#selSpecie').change(function(){ setBreedOptions(this.value); }); $('#frmEntryPane').click(function() { if ($('#boiteaddmsg').is(':visible')) { $('#boiteaddmsg').slideUp(); $('#frmEntryPane').text('{lang_click_new_an...
/* globals commonTests */ const THIRD_PARTY_ORIGIN = 'https://good.third-party.site'; const THIRD_PARTY_TRACKER_ORIGIN = 'https://broken.third-party.site'; const storeButton = document.querySelector('#store'); const retriveButton = document.querySelector('#retrive'); const downloadButton = document.querySelector('#dow...
import {DetailedError} from "src/base/DetailedError.js"; import {createTextureByDrawingToCanvas} from "src/draw/util.js"; import {Rect} from "src/geo/Rect.js"; // Work around WebStorm not recognizing some WebGL types. //noinspection ConstantIfStatementJS if (false) { //noinspection JSUnusedLocalSymbols functio...
import Component from 'ember-appointment-slots-pickers/components/slots-picker/base/component'; import { computed } from '@ember/object'; import layout from './template'; export default Component.extend({ layout, selected: computed('multiSelected', function () { const selected = this.multiSelected; retur...
import React from 'react' import PropTypes from 'prop-types' import Typography from '@material-ui/core/Typography' import { withStyles } from '@material-ui/core/styles' class Total extends React.PureComponent { render() { const { classes, total } = this.props return do { if (total < 0)...
module.exports = (...args) => { process.env.IS_DEBUG && console.log(...args); };
// pages/meirituijan/meirituijan.js import axios from "../../util/axios.js"; import PubSub from 'pubsub-js'; Page({ /** * 页面的初始数据 */ data: { commentList: [], day: "", month: "", songIndex: null }, // 去song页面 toSong(event) { // 路由传参,将当前的id值传递过去,拿到id值取发送请求,获取数据 let { songid,...
const express = require('express'); const routes = require('./routes'); require('./database'); const app = express(); app.use(express.urlencoded()); app.use(function (req, res, next) { res.header('Access-Control-Allow-Origin: *'); res.header("Access-Control-Allow-Headers: Origin, X-Requested-With, Content-T...
import React from "react"; import { connect } from "react-redux"; import { fetchTrendingList, fetchCoinData, setVisibilityFilter } from "../actions"; class TrendingList extends React.Component { componentDidMount() { this.props.fetchTrendingList(); } handleClick(coin) { this.props.fetchCo...
var os = require('os'); var proc = require('child_process'); var hubiquitus = require(__dirname + '/../../index'); os.cpus().forEach(function () { proc.fork(__dirname + '/launcher'); }); hubiquitus.start({discoveryAddr: 'udp://224.0.0.1:5555'}) .send('anonymous', 'test', 'start') .addActor('test', function () {...
(function(ns) { 'use strict'; ns.Animal = function Animal (name, dob) { if (typeof name !== 'string') { throw new TypeError('Please give a name to your animal'); } this.dob = new Date(dob); if (this.dob.toString() === 'Invalid Date') { throw new TypeE...
var Zia; (function (Zia) { var Texture = (function () { function Texture(graphicsDevice, options, textureType) { var gl = this._gl = graphicsDevice.gl; this._texture = this._gl.createTexture(); this._textureType = textureType; this._options = Zia.ObjectUtil.re...
var React = require('react'); var CartList = require('./CartList.jsx'); var CartBox = React.createClass({ render: function(){ return ( <div> <CartList products={ this.props.products } removeFromCart = {this.props.removeFromCart}></CartList> </div> ) } }) module.exports = CartBox;
$(document).ready(function () { var id_usuario = $('#id_usuario').val(); var fecha_hoy = $('#fecha_hoy').val(); var page = $('#txtPage').val(); var funcion = ""; var id_usuario = $('#id_usuario').val(); buscar_avatar(id_usuario); if(page=="adm"){ buscarGestionReservas(); } ...
import { connect } from 'react-redux'; import RatingStarForm from './star_rating'; const mSTP = (state,ownProps) => { return { readOnly: ownProps.readOnly, rate: ownProps.rate } }; export default connect(mSTP, null)(RatingStarForm);
import React from "react"; import Form from "../../components/Form/form"; const inputsList = { search: "" }; const inputs = [ { label: "Введите данные для поиска", variant: "standard", type: "text", name: "search", id: "search" } ]; const SearchBar = () => { const onSubmit = (e, formData) ...
$(function() { var showPromo = false; $(window).scroll(function() { var textHeight = $(".body-text").offset().top; // console.log("TextHeight: " + textHeight); if ($(this).scrollTop() >= textHeight) { if (!showPromo) { showPromo = true; $(".s...
import './style' import h from '@kuba/h' function component () { return ( <input className='search__input' type='search' name='search' placeholder='Busque por produto, categoria ou marca' /> ) } export default component
import BaseCollapse from 'ember-bootstrap/components/base/bs-collapse'; import { classNameBindings } from '@ember-decorators/component'; @classNameBindings('showContent:in') export default class Collapse extends BaseCollapse {}
test('toHaveBeenCalledWith(arrayContaining)', () => { const myFunction = jest.fn(); myFunction([1, 2, 3]); expect(myFunction).toHaveBeenCalledWith(expect.arrayContaining([2])); }); test('toHaveBeenCalledWith(objectContaining)', () => { const myFunction = jest.fn(); myFunction({ name: 'Hugo', website:...
import IdArray from "../loose/idArray.mjs"; import {decodeNetMsg,encodeNetMsg} from "../loose/netMsg.mjs"; import {MetaRadar, MetaMove, UnknownComponent} from "./components.mjs"; export default class Ship { constructor(network) { this.network = network ; this.componentTypes = [] ; this.components = [] ; ...
const chai = require("chai"); const chaiHttp = require("chai-http"); const server = require("../server"); chai.should(); const expect = chai.expect; chai.use(chaiHttp); const userCredentials = { userName: 'joh@ymail.com', password: 'password' } // before any test user is logged in var authenticatedUser = chai....
export const getCatFactsEndpoint = state => state.appConfig.endpoints.catFacts; export const boo = 'boo'; // This is just to remove the annoying "Prefer default export" ESLint error.
/* * Copyright (c) 2014. * * @Author Andy Tang */ (function LinkedHashMapSpecScope(undefined) { 'use strict'; describe('LinkedHashMap', function LinkedHashMapSpec() { describe('initalizing an LinkedHashMap', function initializingLinkedHashMap() { it('should be able to add an entry to ...
import debug from 'debug' import React, {Component} from 'react' import {bindActionCreators} from 'redux' import {connect} from 'react-redux' import {Link} from 'react-router' import * as actions from './session/actions' import getAuth from './session/session' const dbg = debug('app:top-nav') @connect( (state) => {...
import React from "react"; import InfiniteScroll from "react-infinite-scroll-component"; import "./App.css"; import collegeImage from "./college.jpg"; import StarRatings from "react-star-ratings"; import Discount from "./Discount"; import Rate from "./Rate"; class App extends React.Component { state = { items: ...
import axios from "axios"; import "./data-mock"; const server = "http://localhost:3000"; const api = axios.create({ baseURL: server, timeout: 1000, headers: { "X-Custom-Header": "foobar" } }); function makeCancelable(promise) { let hasCanceled = false; const wrappedPromise = new Promise((resolve, reject) =...
'use strict'; const { Genre, connect, disconnect, } = require('./database.js'); const { runMigrations, rollbackMigrations } = require('../migrations/run.js'); beforeAll(async () => { await runMigrations(); }); describe('Testing Author table', async () => { it('Checks if genres are retrieved from...
export const weddings = { heroImgUrl: 'https://images.unsplash.com/photo-1457102053979-b1da354f1785?ixlib=rb-0.3.5&ixid=eyJhcHBfaWQiOjEyMDd9&s=654265c814f344788651a3cb33d01da1&auto=format&fit=crop&w=1267&q=80', pageTitle: 'Weddings', pageSlogan: 'Plan the perfect wedding. Get introduced to the right professio...
var mongoose = require('mongoose'); var User = require('./user'); var TripComponent = require('./trip-component'); var Schema = mongoose.Schema; var policySchema = new Schema({ id: Schema.Types.ObjectId, name: String, permittedComponents: [TripComponent], basePrice: Number, isGeneralPolicy: Boolea...
var can = document.getElementById('c'), mycontext = can.getContext('2d'); mycontext.fillStyle='rgba(100,20,10,0.43)'; mycontext.fillRect(0, 0, 1280, 400); mycontext.font='140px Arial'; mycontext.lineWidth =4; mycontext.strokeStyle='#ddd'; mycontext.fillStyle='#00f'; mycontext.strokeText('E', 200, 180); mycontext.fil...
import { put, take, call, fork } from 'redux-saga/effects'; import * as types from '../constants/ActionTypes'; export function* requestStorySetList() { try { } catch (error) { yield put(receiveArticleList([], typeId)); toastShort('网络发生错误,请重试'); } } export function* watchRequestStorySetList() { ...
// 可用支付方式 var DM_PayTypeList = function(){ MessageMachine.call(this); // url this.url = url_host+"/pay/paymentType.json"; // template this._template= '\ {{if status == 1}}\ <div id="{{payType}}" onclick="changeTab(id);">\ <div class="ub ub-fh ub-ac">\ <div class="ub-img umw...
import {fromJS} from "immutable"; import * as constants from "./actionTypes"; const defaultState = fromJS({ searchParams: {}, createUserInfo: {}, tableData: {count: 0, num: 0, data: []}, visible: false, pagination: { current: 1, pageSize: 10, total: 0 }, userInfo: {}...
const form = document.forms.namedItem('button1'); let today = new Date().toISOString().substr(0, 10); document.querySelector("#date").value = today; form.addEventListener ( 'submit', (event) => { event.preventDefault(); document.location.href = "books.html"; } );
const DecoJardin=require('../Modele/decojardinModel') exports.create=(req,res)=>{ const newDecoJardin=new DecoJardin({ name:req.body.name, ImageDecojardin:req.file.originalname, categori:req.body.categori, prix:req.body.prix, quantite:req.body.quantite }) newDecoJar...
let BaseMenu = require("./basemenu.js"); /** * The Class Selection menu. Displays a list of classes to choose from. When this menu is loaded, it must be passed an object containing the unit to be modified. On selection, the menu will set the unit's class, then either exit or continue along the character creation proc...
import React from 'react'; import { makeStyles, Typography, Card } from '@material-ui/core'; const useStyles = makeStyles(theme => ({ box: { marginTop: 10 + 'em', marginLeft: 2 + 'em', marginRight: 2 + 'em', backgroundColor: '#b53838', overflow: 'hidden', color: 'white', padding: 10 + 'px...
import { Button, Form, Input } from 'antd'; import React, { memo, useCallback, useEffect, useState } from 'react'; import { useHistory } from 'react-router-dom'; import { useSecurityContext } from '../context/SecurityContext'; import styled from 'styled-components'; const Container = styled.div` min-height: 100vh; ...
import server from './server'; import logger from 'winston'; import * as fake from './fake'; const port = process.env.PORT || 3000; server.create(port).run(() => { logger.info('Running on port %s', port); }); fake.start();
const xss = require('xss') const { exec } = require('../db/mysql.js') const getList = (author, keyword) => { let sql = `select * from blogs where 1=1 ` if (author) { sql += `and author='${author}' ` } if (keyword) { sql += `and title like '%${keyword}%' ` } sql += `order by createtime desc` retur...
'use strict'; /** * @ngdoc overview * @name friendsFeedApp * @description This is a simple angular app to mimic a news feed based on friendship (friends can see each other's posts) * # friendsFeedApp * * Main module of the application. */ angular .module('friendsFeedApp', [ 'ngAnimate', 'ngCookies', ...
import AuthApi from '../api/AuthApi'; import MainApi from '../api/MainApi'; export const SET_TEACHER_LIST = 'SET_TEACHER_LIST'; export const getAllTeacher = (name) => async (dispatch) => { try { const response = await MainApi.get( `/teachers?page=0&size=10&sort=createdAt,desc&name=${name}`, ); if...
import React, {Component} from 'react'; import {render} from 'react-dom'; import {IMG_CONSTANT, APP_CONSTANT} from '../constants/application.constants'; import {connect} from 'react-redux'; import {bindActionCreators} from 'redux'; import {registerUser} from '../actions/registerAction'; import {contactUs, faceboo...
export const SliderData = [ { image:'https://s3.us-west-2.amazonaws.com/com.admitonelive.content.images/react-admitonelive/1610659452321-Alec-Benjamin.jpg', link:'#', title:'Music of Cream', date:'Apr 11, Sun - 8:00pm', place:'Phoenix Concert Theatre - Toronto, ON', }, ...
import React from "react"; import { Story } from "storybook/assets/styles/common.styles"; import Select from "../SelectExample"; const ScreenerStory = () => ( <Story> <Select placeholder="Tell me a story..." size="small" a11yText="story"> <option value="Pepsi">Pepsi</option> <option value="Coke">Coke...
define(["DeferredUtil","WebSite","assert"], function (DU,WebSite,A) { var CPR=function (ns, url) { A.is(arguments,[String,String]); return { getNamespace:function () {return ns;}, sourceDir: function () {return null;}, getDependingProjects: function () {return [];},// virtual loadDependingClasses: func...
$(document).ready(function() { if ($("#alertSuccess").text().trim() == "") { $("#alertSuccess").hide(); } $("#alertError").hide(); refresh(); }); $(document).on("click","#btnSave",function(event) { $("#alertSuccess").text(""); $("#alertSuccess").hide(); $("#alertError").text(""); $("#alertError...
//aliases for pixi container var stage; var renderer = PIXI.autoDetectRenderer(512, 512), TextureCache = PIXI.utils.TextureCache, Sprite = PIXI.Sprite, resources = PIXI.loader.resources; var upKey = keyboard(87); var downKey = keyboard(83); var leftKey = keyboard(65); var rightKey = keyboard(68); var play...
module.exports = class TypeWrapper { constructor( type, opts ) { this.type = type; if ( opts ) { Object.keys( opts ).forEach( k => { this[ k ] = opts[ k ]; } ); } } nullable( val = true ) { this.isNull = val; return this; } };
/** * @file .eslintrc.js * @author suyan wang * @description eslint config file */ module.exports = { extends: [ '@ecomfe/eslint-config', '@ecomfe/eslint-config/typescript' ], rules: { "comma-dangle": ["error", "never"] }, ignorePatterns: [ 'node_modules/*', ...
import React from "react"; import { Link } from "react-router-dom"; import "./components.css"; const bg = "hsla(120,100%,75%,0.3)"; const HomeComponent = ({ name, src, link, alert }) => { return ( <div className="col compHome"> <Link to={link} className="text-decoration-none"> <div class...
const fs = require('fs'); module.exports.directoryExists = (filePath) => { try { return fs.statSync(filePath).isDirectory(); } catch (err) { return false; } }; module.exports.fileExists = (filePath) => { try { return fs.statSync(filePath).isFile(); } catch (err) { return false; } };
var trim = require('./') var test = require('tape') test('trims query and hash parameters off a URL', function (t) { // don't modify empty URLs t.equal(trim(''), '') t.equal(trim(), '') t.equal(trim('http://localhost:9966///'), 'http://localhost:9966/') t.equal(trim('http://localhost:9966'), 'http://localho...
(function($){ //field inputs var company_price = $('.company_price input'), less = $('.less input'), net_price = $('.net_price input'); var wRate = $('.wRate input'), wPrice = $('.wPrice input'), rRate = $('.rRate input'), rPrice = $('.rPrice input'); $(company_price).blur(function(){ ...
//ownersController.js (function () { "use strict"; //create a controller: (getting the existing module) angular.module("appOwner") .controller("ownersController", ownersController); //$http - call to server function ownersController($http,$scope) { //ViewModel var vm = t...
const express=require("express"); const bodyParser=require("body-parser"); const db=require("./dbutils"); const app=express(); app.use(bodyParser.urlencoded({extended:false})); app.use(bodyParser.json()) //配置数据库的信息 db.config("mongodb://127.0.0.1:27017","userInfo"); //注册 app.post("/registry",function(request,respons...
import fetch from 'isomorphic-fetch'; export const getUsername = () => { return fetch('/api2/profile/', { method: 'GET', credentials: 'include' }); };
import React, {Component} from 'react'; import classes from './Logo.css'; import burgerLogo from '../../assets/images/burger-logo.png'; class logo extends Component { state = { loading: true } handleImageLoaded = () => { this.setState({loading: false}); } render () { ret...
import isBrowser from './feature-detection/is-browser' import generateID from './id/generate-id' import IDGenerator from './id/id-generator' import deepExtend from './object/deep-extend' import extend from './object/extend' import indexOfRegex from './string/index-of-regex' import lastIndexOfRegex from './string/last-i...
function checkStorage(available, ordered) { let message; // Пиши код ниже этой строки if (ordered == 0) { message = "В заказе еще нет товаров"; } else if (ordered > available) { message = "Слишком большой заказ, на складе недостаточно товаров!"; } else { message = "Заказ оформлен, с вами свяжется ...
let operador = null; function insert(num, op = false) { var numero = document.querySelector('.tela').innerText; console.log(numero, num) document.querySelector('.tela').innerText = numero + num if (op) { operador = num; console.log(operador) } } function clean () { document.quer...
// internal variables var _canvas; var _midi; var _fps = 60; var _width; var _height; var _ctx; var _obsts = []; var _rateOfChange = 0; var _playerX; var _projectedPos; var _playerY = 140; var _lastNote = 60; var _state; var _lastT = 0; var _numKeysPressed = 0; var _curNote = 60; var _bottomNote = 21; var _topNote = 10...
$(document).ready(function(){ var date = new Date(); console.log(date) var dd = parseInt(String(date.getDate()).padStart(2, '0')); var mm = parseInt(String(date.getMonth() + 1).padStart(2, '0')); //January is 0! var yyyy = date.getFullYear(); photoOfDay(yyyy,mm,dd); function photoOfDay(yyyy...
import { getItem } from "utils"; const initialState = { page: 1, perPage: 15, photos: getItem(48), photo: null, editModal: false, errorModal: false, refetch: false, loader: false, numObjects: 0 }; const reducer = (state = initialState, action) => { switch (action.type) { case "UPLOAD_PHOTO": ...
/* app.js * Base component that implement the render() method and is responsible toload the HTML content. * @Author: Kailash Sharma * @Since: 28-Apr-2016 */ import 'babel-polyfill'; import React from 'react'; import ReactDOM from 'react-dom'; import { browserHistory } from 'react-router' import configureStore...
import {Text, TouchableOpacity, View, StyleSheet, Keyboard} from "react-native"; import React, {useEffect, useState} from "react"; export const AppButton = ({text = 'Начать', onPress, disabled, style={}}) => { const disabledStyle = disabled ? { backgroundColor: 'rgba(0, 0, 0, 0.1)' } : {} useEffect(() => { ...
// var commandService = require("commandService"); // var componentService = require("componentService"); // // var columns = {}; // // var columnsFromServer = []; // // var isColumnSet = false; // // var notifications = []; // // var columnViewIsOpenned = false; // // commandService.on("allColumns", function(res...
//sample variable as function var sumthem = function(x, y) { return x + y; }; console.log(sumthem(10,5));
Meteor.publish('images.byCategory', function(categoryId) { check(categoryId, String); return Images.find({ categoryId: categoryId }); });
module.exports = { "presets": [ [ "babel-preset-gatsby", ], ], "plugins": [ [ "babel-plugin-ttag", { "resolve": { "translations": process.env.LOCALE === "es" ? "es.po" : "default", }, }, ], ], }
import React, { Component } from 'react'; import API from '../../services/api'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome' import { faBackspace } from '@fortawesome/free-solid-svg-icons'; import { Link } from "react-router-dom"; export default class PedidoDetalhes extends Component { state...
var syllabus = { 19: { title: 'Unit 1 - Getting Started: Preview & Setup', lessons: { 48: '1.1 Welcome to MobileCSP', 69: '1.2 Mazes, Algorithms, and Programs', 49: '1.3 Google Account and Portfolio Set Up', 50: '1.4 App Inventor Setup', 70: '1.5 Blown to Bits (BB)', ...
// Move class function Move(round){ var self = this; // methods self.started = function(){ //console.log("move start"); //console.log(self); ANIMIX.activeMove = true; $( ui.grid ).on( "mousedown", ui.tile, { round: round }, tileMgr.validate ); }; // Move.started() self.ended = function(){ ANI...
import React, {useState} from 'react' import man from '../../assets/images/dashboard/user.png' import { Dropdown, DropdownToggle, DropdownMenu } from 'reactstrap'; import {Users,MessageSquare,FileText,Settings,LogOut} from 'react-feather' const UserActivity = () => { const [dropdownOpen, setDropdownOpen] = useStat...
/** * Created by nnnyyy on 2018-11-21. */ 'use strict'; import P from '../common/protocol'; class Global { constructor() { this.vBus = new Vue(); } connectSocket() { console.log('socket connecting...'); this.socket = io(); this.initSocketListener(); } initSocket...
import { createStore, applyMiddleware, compose, combineReducers } from 'redux' import { connectRoutes } from 'redux-first-router' import reduxThunk from 'redux-thunk' // import persistState from 'redux-localstorage' import routesMap from './routes' import options from './options' import * as reducers from './r...
// react-bootstrap components import React, { useEffect, useState } from "react"; import { Form } from "react-bootstrap"; import NotificationAlert from "react-notification-alert"; import axios from "axios"; import SERVER from "../globals"; import { Badge, Button, Card, Navbar, Nav, Container, Row, Co...
import React, { Component } from 'react'; import classnames from 'classnames'; import PropTypes from 'prop-types'; import { withStyles } from '@material-ui/core/styles'; import { Card, CardHeader, IconButton, CardContent, Typography, Grid, Collapse } from '@material-ui/core'; import ExpandMoreIcon from '@material-ui/ic...
//------------------------------------------------------------------------------------------------------------ // // MatrixEngine Core Program // build number 1.0.20130523 // //------------------------------------------------------------------------------------------------------------ var MxeProject = function() { ...
import React from "react"; import "../ad_inventory/datecard.css" function DateCard() { var date = new Date(); var today = date.getDate() + " - " + (date.getMonth() + 1) + " - " + date.getFullYear(); const newTime = new Date().toLocaleTimeString(); return ( <div className="cardFloat"> ...
import { createStackNavigator } from 'react-navigation-stack'; import { createAppContainer } from 'react-navigation'; import React from 'react'; import { TouchableOpacity } from 'react-native'; import Icon from 'react-native-vector-icons/FontAwesome'; import GetStarted from '../screens/getStarted'; import PhoneInput fr...
import {BrowserRouter as Router, Route, Switch } from 'react-router-dom'; import './App.css'; import Home from './Components/Home/Home'; import Login from './Components/Login/Login'; import Signup from "./Components/Signup/Signup"; import Navbar from './Components/NavBar/Navbar'; import Survey from "./Components/Survey...
// return date today const today = `${new Date().getFullYear()}-${new Date().getMonth()+1}-${new Date().getDate()}`; module.exports = { today }
const mongoose = require("mongoose"); const schema = new mongoose.Schema({ id: Number, title: String, content: String, author: String, datePosted: Date, image: String, }); module.exports = mongoose.model("Articles", schema, "Articles");
const mongoose = require("mongoose"); const Schema = mongoose.Schema; const User = require("../User"); const DenneSchema = new Schema({ createdDate: { type: Date, default: Date.now, }, hotel: { type: mongoose.Schema.ObjectId, ref: "Hotel", required: true, }, isBooking: { type: Boolean...
import React, { useState } from "react"; // Contains checkbox logic const Checkbox = ({ categories, handleFilters }) => { const [checked, setCheked] = useState([]); // Grab category id and put them // in an array so we can send it // to the backend to get all the // products based on category // accepts c...
export function Minus(props) { return ( <svg id="Layer_1" data-name="Layer 1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" {...props} > <defs> <style>{'.cls-1{fill-rule:evenodd}'}</style> </defs> <path className...
import React from "react"; import styled from "styled-components"; import SubscribeForm from "./SubscribeForm"; const HomeStyledHero = styled.div` height: calc(100vh - 70px); width: 100%; background-color: gray; background-image: url("https://live.staticflickr.com/65535/51162644248_86d25a4d61_b.jpg"); backgr...
import React from 'react' function SelectType (props) { let {allTypes, gameStatus, handleSelectType} = props return ( <div className="select-types"> <h4>请选择类型:</h4> { allTypes.map(matrixType => ( <button key={matrixType} onClick={() => handleSelectType(...
import { Meteor } from 'meteor/meteor'; Meteor.methods({ createTask(title, desc, assigneeEmails) { check(desc, String); check(assigneeEmails, Array); check(title, String); try { Tasks.insert({ user_id: this.userId, title: title, description: desc, assignee_emails:assigneeEmails, created...
import React from "react"; import { observer, useObservable } from "mobx-react-lite"; const ReactMobx = observer(() => { const store = useObservable({ count: 1, addOne() { store.count++; }, subOne() { store.count--; } }); function addOneHandle() { store.addOne(); } functi...
import React from 'react'; import ReactSelect from './ReactSelect'; class ActivityRow extends React.Component { constructor(props) { super(props); this.state = { activityList: [ { name: 'BREAK DOWN TIME', value: '1' }, { name: 'CHANGE OVER', value: '2' }, { name: 'COOLING TANK C...
WMS.module("Header", function(Header, WMS, Backbone, Marionette, $, _) { var API = { listHeaders: function() { Header.List.Controller.listHeaders(); } }; WMS.commands.setHandler('set:active:header', function(name) { Header.List.Controller.setActiveHeader(name); }); Header.on('start', f...
import React from "react"; import { shallow, mount } from "enzyme"; import Feedback from "./feedback"; describe("Renders feedback", () => { it("renders feedback shallowly", () => { shallow(<Feedback />); }); });
import React from 'react'; import { Provider } from 'react-redux'; import { createStore } from 'redux'; import { storiesOf } from '@storybook/react'; import { action } from '@storybook/addon-actions'; import StoryRouter from 'storybook-react-router'; import { DocsPage, DocsContainer } from '@storybook/addon-docs/blocks...