Skip to content

Instantly share code, notes, and snippets.

const Demo = () => {
const [open, setOpen] = useState(false)
return (
<>
<button onClick={() => setOpen(true)}>Open Modal</button>
<Modal open={open} onClose={() => setOpen(false)}>
<Modal.Header>Modal Header goes here</Modal.Header>
<Modal.Content>Modal Content goes here</Modal.Content>
<Modal.Footer>Modal Footer goes here</Modal.Footer>
</Modal>
import React from "react";
import { connect } from 'react-redux';
import { fabric } from "fabric";
import imagesReducer from "reducers/images";
import Filter from "components/Home/Filter";
import { Wrapper, CanvasWrapper, Row, Column } from "./styled";
// Below there is functional component approach
import json
import graphene
from graphql_relay.node.node import from_global_id
from companies import models
from companies.schema import CompanyNode, BrandNode
from franchise.utils import get_instance
class CompanyInput(graphene.InputObjectType):
class Company(models.Model):
owner = models.ForeignKey(User, on_delete=models.CASCADE, null=True)
name = models.CharField(max_length=150, blank=False, null=False)
phone_number = models.CharField(max_length=15, blank=False, null=False)
class Brand(models.Model):
company = models.ForeignKey(Company, related_name='company_brand', on_delete=models.CASCADE)
name = models.CharField(max_length=150, blank=False, null=False)
accounts/models.py
class Role(models.Model):
ROLE_CHOICES = (
('agent', 'Agent'),
('agency', 'Agency'),
('manufacturer', 'Manufacturer'),
)
console.log('background script running')
import React from 'react';
import { Field } from 'redux-form';
import { PrimaryButton, TransparentButton } from 'Components/Generics/Buttons';
import { GTextField } from 'Components/Generics/Forms';
import FormHeadline from '../Generics/FormHeadline';
import {
Wrapper,
GridContainer,
FormWrapper,
InlineForm,
import { reduxForm } from 'redux-form';
import { connect } from 'react-redux';
import {
compose,
withState,
withHandlers,
lifecycle,
setStatic,
} from 'recompose';
import validate from 'Components/Generics/Forms/validate';
import pdb
import datetime
from carts.models import Cart, CartItem
from products.models import Variation
CART_ID = 'cart-id'
class Cart(object):
//app
const App = props => (
<Switch>
<UnauthenticatedRoute path="/login" name="login" component={AsyncLogin} {...props} />
<UnauthenticatedRoute path="/signup" name="signup" component={AsyncSignUp} {...props} />
<AuthenticatedRoute path="/" name="Home" component={AsyncHome} {...props} />
</Switch>
);