Skip to content

Commit

Permalink
update beta version in examples
Browse files Browse the repository at this point in the history
  • Loading branch information
nasdan committed Jul 28, 2020
1 parent 9dfd5f4 commit a64002e
Show file tree
Hide file tree
Showing 18 changed files with 103 additions and 111 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ button.outline {
align-items: baseline;
}

.row > :nth-child(n+2) {
.row > :nth-child(n + 2) {
margin-left: 1rem;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import "./helper.css";
import './helper.css';

import React from "react";
import { render } from "react-dom";
import { Formik, Form, Field, ErrorMessage, FieldArray } from "formik";
import { formValidation } from "./form-validation";
import React from 'react';
import { render } from 'react-dom';
import { Formik, Form, Field, ErrorMessage, FieldArray } from 'formik';
import { formValidation } from './form-validation';

const createEmptyUser = () => ({
name: "",
email: "",
repeatEmail: ""
name: '',
email: '',
repeatEmail: '',
});

const App = () => (
Expand Down Expand Up @@ -95,4 +95,4 @@ const App = () => (
</div>
);

render(<App />, document.getElementById("root"));
render(<App />, document.getElementById('root'));
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ button.outline {
align-items: baseline;
}

.row > :nth-child(n+2) {
.row > :nth-child(n + 2) {
margin-left: 1rem;
}

Expand Down
18 changes: 9 additions & 9 deletions examples/formik/js/shopping-cart-array-validator/index.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import "./helper.css";
import './helper.css';

import React from "react";
import { render } from "react-dom";
import { Formik, Form, Field, ErrorMessage, FieldArray } from "formik";
import { formValidation } from "./form-validation";
import React from 'react';
import { render } from 'react-dom';
import { Formik, Form, Field, ErrorMessage, FieldArray } from 'formik';
import { formValidation } from './form-validation';

const createEmptyProduct = () => ({
name: "",
quantity: "",
price: ""
name: '',
quantity: '',
price: '',
});

const App = () => (
Expand Down Expand Up @@ -95,4 +95,4 @@ const App = () => (
</div>
);

render(<App />, document.getElementById("root"));
render(<App />, document.getElementById('root'));
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,7 @@ const App = () => (
<Field name={`users[${index}].email`}>
{({ input, meta }) => (
<div className="input">
<input
{...input}
type="text"
placeholder="Email"
/>
<input {...input} type="text" placeholder="Email" />
{meta.error && meta.touched && (
<span className="input-feedback">{meta.error}</span>
)}
Expand All @@ -69,7 +65,11 @@ const App = () => (
<Field name={`users[${index}].repeatEmail`}>
{({ input, meta }) => (
<div className="input">
<input {...input} type="text" placeholder="Repeat email" />
<input
{...input}
type="text"
placeholder="Repeat email"
/>
{meta.error && meta.touched && (
<span className="input-feedback">{meta.error}</span>
)}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ How to validate a user list when it creates multiple users.

[![See fonk example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/lemoncode/fonk/tree/feature/validate-array-fields/examples/react-final-form/js/multiple-user-creation-array-validator)


# About Basefactor + Lemoncode

We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from "styled-components";
import styled, { css } from 'styled-components';

const btn = (light, dark) => css`
white-space: nowrap;
Expand Down Expand Up @@ -28,10 +28,10 @@ const btn = (light, dark) => css`
`;

const btnDefault = css`
${btn("#ffffff", "#d5d5d5")} color: #555;
${btn('#ffffff', '#d5d5d5')} color: #555;
`;

const btnPrimary = btn("#4f93ce", "#285f8f");
const btnPrimary = btn('#4f93ce', '#285f8f');

export default styled.div`
display: flex;
Expand Down Expand Up @@ -71,7 +71,7 @@ export default styled.div`
& > div {
margin: 5px;
& > input[type="checkbox"] {
& > input[type='checkbox'] {
margin-top: 7px;
}
& > div {
Expand All @@ -92,12 +92,12 @@ export default styled.div`
}
button {
margin: 0 10px;
&[type="submit"] {
&[type='submit'] {
${btnPrimary};
margin-top: 1rem;
margin-bottom: 1rem;
}
&[type="button"] {
&[type='button'] {
${btnDefault};
}
}
Expand Down
22 changes: 11 additions & 11 deletions examples/react-final-form/js/shopping-cart-array-validator/index.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
import React from "react";
import { render } from "react-dom";
import Styles from "./styles";
import { Form, Field } from "react-final-form";
import arrayMutators from "final-form-arrays";
import { FieldArray } from "react-final-form-arrays";
import { formValidation } from "./form-validation";
import React from 'react';
import { render } from 'react-dom';
import Styles from './styles';
import { Form, Field } from 'react-final-form';
import arrayMutators from 'final-form-arrays';
import { FieldArray } from 'react-final-form-arrays';
import { formValidation } from './form-validation';

const onSubmit = values => {
console.log({ values });
};

const createEmptyProduct = () => ({
name: "",
quantity: "",
price: ""
name: '',
quantity: '',
price: '',
});

const App = () => (
Expand Down Expand Up @@ -90,4 +90,4 @@ const App = () => (
</Styles>
);

render(<App />, document.getElementById("root"));
render(<App />, document.getElementById('root'));
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ How to validate a products list in shopping cart.

[![See fonk example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/lemoncode/fonk/tree/feature/validate-array-fields/examples/react-final-form/js/shopping-cart-array-validator)


# About Basefactor + Lemoncode

We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from "styled-components";
import styled, { css } from 'styled-components';

const btn = (light, dark) => css`
white-space: nowrap;
Expand Down Expand Up @@ -28,10 +28,10 @@ const btn = (light, dark) => css`
`;

const btnDefault = css`
${btn("#ffffff", "#d5d5d5")} color: #555;
${btn('#ffffff', '#d5d5d5')} color: #555;
`;

const btnPrimary = btn("#4f93ce", "#285f8f");
const btnPrimary = btn('#4f93ce', '#285f8f');

export default styled.div`
display: flex;
Expand Down Expand Up @@ -71,7 +71,7 @@ export default styled.div`
& > div {
margin: 5px;
& > input[type="checkbox"] {
& > input[type='checkbox'] {
margin-top: 7px;
}
& > div {
Expand All @@ -92,12 +92,12 @@ export default styled.div`
}
button {
margin: 0 10px;
&[type="submit"] {
&[type='submit'] {
${btnPrimary};
margin-top: 1rem;
margin-bottom: 1rem;
}
&[type="button"] {
&[type='button'] {
${btnDefault};
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
<!DOCTYPE html>
<html lang="en">

<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<meta name="theme-color" content="#000000">
<!--
<head>
<meta charset="utf-8" />
<meta
name="viewport"
content="width=device-width, initial-scale=1, shrink-to-fit=no"
/>
<meta name="theme-color" content="#000000" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json">
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico">
<!--
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<link rel="shortcut icon" href="%PUBLIC_URL%/favicon.ico" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.
Expand All @@ -20,15 +22,15 @@
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>React App</title>
</head>
<title>React App</title>
</head>

<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
<body>
<noscript>
You need to enable JavaScript to run this app.
</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.
Expand All @@ -38,6 +40,5 @@
To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>

</body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ How to validate a user list when it creates multiple users.

[![See fonk example](https://codesandbox.io/static/img/play-codesandbox.svg)](https://codesandbox.io/s/github/lemoncode/fonk/tree/feature/validate-array-fields/examples/react-final-form/ts/multiple-user-creation-array-validator)


# About Basefactor + Lemoncode

We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,4 @@
import {
Validators,
ValidationSchema,
} from '@lemoncode/fonk';
import { Validators, ValidationSchema } from '@lemoncode/fonk';
import { createFinalFormValidation } from '@lemoncode/fonk-final-form';
import { matchField } from '@lemoncode/fonk-match-field-validator';

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import styled, { css } from "styled-components";
import styled, { css } from 'styled-components';

const btn = (light, dark) => css`
white-space: nowrap;
Expand Down Expand Up @@ -28,10 +28,10 @@ const btn = (light, dark) => css`
`;

const btnDefault = css`
${btn("#ffffff", "#d5d5d5")} color: #555;
${btn('#ffffff', '#d5d5d5')} color: #555;
`;

const btnPrimary = btn("#4f93ce", "#285f8f");
const btnPrimary = btn('#4f93ce', '#285f8f');

export default styled.div`
display: flex;
Expand Down Expand Up @@ -71,7 +71,7 @@ export default styled.div`
& > div {
margin: 5px;
& > input[type="checkbox"] {
& > input[type='checkbox'] {
margin-top: 7px;
}
& > div {
Expand All @@ -92,12 +92,12 @@ export default styled.div`
}
button {
margin: 0 10px;
&[type="submit"] {
&[type='submit'] {
${btnPrimary};
margin-top: 1rem;
margin-bottom: 1rem;
}
&[type="button"] {
&[type='button'] {
${btnDefault};
}
}
Expand Down
Loading

0 comments on commit a64002e

Please sign in to comment.