Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use pikkr package to get a result #9

Merged
merged 1 commit into from Feb 6, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -22,6 +22,7 @@
"@types/react-dom": "16.0.11",
"@types/styled-components": "^4.1.8",
"fontfaceobserver": "^2.1.0",
"pikkr": "^1.0.0",
"react": "^16.7.0",
"react-dom": "^16.7.0",
"react-dom-confetti": "^0.1.0",
Expand Down
4 changes: 2 additions & 2 deletions src/components/App/App.tsx
Expand Up @@ -7,7 +7,7 @@ import LoadFonts from '../../fonts';
import Form from '../Form';
import Layout from '../Layout';

import { config } from '../../utils/config';
import { config } from '../../utils';

class App extends Component {
state = {
Expand All @@ -34,7 +34,7 @@ class App extends Component {
});
};

updateResult = (result: string | boolean) => {
updateResult = (result: string | number | boolean) => {
// if result comes back false it means there was an error
// so set error to true
if (!result) {
Expand Down
5 changes: 2 additions & 3 deletions src/components/Form/Form.tsx
@@ -1,10 +1,9 @@
import React, { Component } from 'react';
import styled from 'styled-components';
import pikkr from 'pikkr';

import Input from '../Input';

import { getResult } from '../../utils/helpers';

interface Props {
updateResult: (result: string | boolean) => void;
}
Expand All @@ -28,7 +27,7 @@ class Form extends Component<Props> {
const { updateResult } = this.props;

// make a decision using each input value and get a result
const result = getResult(firstInput, secondInput);
const result = pikkr([firstInput, secondInput]);

// update parent state with this result using the function
// passed via props
Expand Down
22 changes: 0 additions & 22 deletions src/utils/helpers.test.ts

This file was deleted.

11 changes: 0 additions & 11 deletions src/utils/helpers.ts

This file was deleted.

File renamed without changes.
3 changes: 2 additions & 1 deletion tslint.json
Expand Up @@ -16,6 +16,7 @@
"member-access": false,
"jsx-no-lambda": false,
"jsx-boolean-value": false,
"object-literal-sort-keys": false
"object-literal-sort-keys": false,
"ordered-imports": false
}
}
655 changes: 371 additions & 284 deletions yarn.lock 100755 → 100644

Large diffs are not rendered by default.