Skip to content

Instantly share code, notes, and snippets.

View ZwaarContrast's full-sized avatar

Zwaar Contrast ZwaarContrast

View GitHub Profile
@ZwaarContrast
ZwaarContrast / signin.js
Last active January 3, 2018 19:52
Sign in Component using updated redux-form.
import React, { Component } from 'react';
import {Field,reduxForm} from 'redux-form';
import {connect} from 'react-redux';
import * as actions from '../../actions';
class Signin extends Component {
handleSignin({ email, password }){
// Log values
console.log('Email', email);
import React, { Component } from 'react';
import {Field,reduxForm} from 'redux-form';
import {connect} from 'react-redux';
import * as actions from '../../actions';
class Signin extends Component {
handleSignin({ email, password }){
// Log values
console.log('Email', email);
import React, {PropTypes} from 'react';
import styled, {css} from 'styled-components';
const HeadingCSS = styled( Heading )`
font-weight: 700;
/* more styling */
`;
const StyledH1 = styled.h1`${ HeadingCSS }`;
const StyledH2 = styled.h2`${ HeadingCSS }`;
@ZwaarContrast
ZwaarContrast / Dropzone.js
Last active May 2, 2023 20:31
Using cypress with react-dropzone to upload a file.
// your react component
import * as React from 'react'
import Dropzone from 'react-dropzone'
// apply your own styling and stuff, should probably also show the files when uploaded
const Upload = () => {
return (<Dropzone data-cy="drag-and-drop">Drag and Drop here</Dropzone>)
}
export default Upload