Skip to content

Instantly share code, notes, and snippets.

View sadam1807's full-sized avatar
🏠
Working from home

sadam bapunawar sadam1807

🏠
Working from home
View GitHub Profile
body {font-family: Arial, Helvetica, sans-serif;}
* {box-sizing: border-box;}
.form-inline {
display: flex;
flex-flow: row wrap;
align-items: center;
}
.form-inline label {
import React, { useState } from 'react'
import './styles.css'
const App = () => {
const [formValues, setFormValues] = useState([{ name: "", email : ""}])
let handleChange = (i, e) => {
let newFormValues = [...formValues];
newFormValues[i][e.target.name] = e.target.value;
let handleChange = (i, e) => {
let newFormValues = [...formValues];
newFormValues[i][e.target.name] = e.target.value;
setFormValues(newFormValues);
}
let addFormFields = () => {
setFormValues([...formValues, { name: "", email: "" }])
}
import React, { useState } from 'react'
const App = () => {
const [formValues, setFormValues] = useState([{ name: "", email : ""}])
return (
<form onSubmit={handleSubmit}>
{formValues.map((element, index) => (
<div className="form-inline" key={index}>
import React from "react";
import './styles.css'
class App extends React.Component {
constructor(props) {
super(props)
this.state = {
formValues: [{ name: "", email : "" }]
};
this.handleSubmit = this.handleSubmit.bind(this)
@sadam1807
sadam1807 / app.css
Last active October 30, 2019 16:03
button {
border: 0;
font-weight: 500;
}
fieldset {
margin: 0;
padding: 0;
border: 0;
}
@sadam1807
sadam1807 / app.js
Last active October 30, 2019 16:03
import React, { useState, useEffect } from 'react';
import './App.css';
import Square from './Component/Square';
const App = () => {
const [isLoad, setLoad] = useState(false);
useEffect(() => {
let sqPaymentScript = document.createElement("script");
// sandbox: https://js.squareupsandbox.com/v2/paymentform
// production: https://js.squareup.com/v2/paymentform
const config = {
// Initialize the payment form elements
//TODO: Replace with your sandbox application ID
applicationId: process.env.REACT_APP_APLLICATION_ID,
inputClass: 'sq-input',
autoBuild: false,
// Customize the CSS for SqPaymentForm iframe elements
inputStyles: [{
fontSize: '16px',
{
"name": "sqpaymentform-nodejs-starterkit",
"version": "0.1.0",
"private": true,
"scripts": {
"start": "nodemon server.js"
},
"dependencies": {
"body-parser": "^1.19.0",
"express": "^4.17.0",
const express = require('express');
const bodyParser = require('body-parser');
const crypto = require('crypto');
const squareConnect = require('square-connect');
const dotenv = require('dotenv');
dotenv.config();
const app = express();
const port = 4000;
var cors = require('cors');
app.use(cors())