Skip to content

Instantly share code, notes, and snippets.

@chitru
chitru / README.md
Created September 10, 2018 14:49 — forked from hofmannsven/README.md
My simply MySQL Command Line Cheatsheet
@chitru
chitru / next-antd-saas.js
Created October 13, 2019 08:00
Nextjs project with antd and saas
const withCss = require('@zeit/next-css')
const withSaas = require('@zeit/next-sass')
module.exports = withCss(withSaas({
webpack: (config, { isServer }) => {
if (isServer) {
const antStyles = /antd\/.*?\/style\/css.*?/
const origExternals = [...config.externals]
config.externals = [
@chitru
chitru / index.js
Created February 5, 2020 10:34
Multistep index
import React from "react";
import ReactDOM from "react-dom";
import "./styles.css";
import MultiStepForm from "./MultiStepForm";
function App() {
return (
<div className="app">
<div className="wrapper">
@chitru
chitru / MultiStepForm.js
Created February 5, 2020 10:38
Multistep form
import React from "react";
import { useForm, useStep } from "react-hooks-helper";
import Names from "./Names";
import Address from "./Address";
import Contact from "./Contact";
import Review from "./Review";
import Submit from "./Submit";
import "./styles.css";
@chitru
chitru / Names.js
Created February 5, 2020 10:52
Multistep form
import React from "react";
import ItemForm from "./ItemForm";
const Names = ({ setForm, formData, navigation }) => {
const { firstName, lastName, nickName } = formData;
const { next } = navigation;
return (
@chitru
chitru / Address,js
Created February 5, 2020 10:53
MultiStepForm
import React from "react";
import ItemForm from "./ItemForm";
import StateDrop from "./StateDrop";
const Address = ({ setForm, formData, navigation }) => {
const { address, city, state, zip } = formData;
const { previous, next } = navigation;
@chitru
chitru / Address.js
Created February 5, 2020 10:54
MultiStepForm
import React from "react";
import ItemForm from "./ItemForm";
import StateDrop from "./StateDrop";
const Address = ({ setForm, formData, navigation }) => {
const { address, city, state, zip } = formData;
const { previous, next } = navigation;
@chitru
chitru / Contact.js
Created February 5, 2020 10:55
MultiStepForm
import React from "react";
import ItemForm from "./ItemForm";
const Contact = ({ setForm, formData, navigation }) => {
const { phone, email } = formData;
const { previous, next } = navigation;
return (
@chitru
chitru / Review.js
Created February 5, 2020 10:56
MultiStepForm
import React from "react";
const Review = ({ setForm, formData, navigation }) => {
const {
firstName,
lastName,
nickName,
address,
city,
state,
@chitru
chitru / Submit.js
Created February 5, 2020 10:56
MultiStepForm
import React from "react";
const Submit = ({ navigation }) => {
const { go } = navigation;
return (
<div>
<h3>Thank you for submitting. We will be in touch</h3>
New Form -> <button onClick={() => go("names")}>New</button>
</div>
);
};