Skip to content

Commit

Permalink
Merge pull request #4 from RalphKemp/logic
Browse files Browse the repository at this point in the history
Logic
  • Loading branch information
RalphKemp authored Feb 2, 2019
2 parents b3aabdd + 3455b27 commit fd6483e
Show file tree
Hide file tree
Showing 5 changed files with 79 additions and 117 deletions.
2 changes: 1 addition & 1 deletion src/components/Homepage.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const MainDiv = styled.div`

const Homepage = () => {
return (
<MainDiv>
<MainDiv>
<Inputs />
<Results />
</MainDiv>
Expand Down
8 changes: 4 additions & 4 deletions src/components/Inputs.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import Search from './Search';
import styled from 'styled-components';
import React from "react";
import Search from "./Search";
import styled from "styled-components";

const MainInputsDiv = styled.div`
height: 100vh;
Expand All @@ -23,6 +23,6 @@ const Inputs = () => {
<Search />
</MainInputsDiv>
);
}
};

export default Inputs;
21 changes: 10 additions & 11 deletions src/components/Results.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import React, { Component } from "react";
import { connect } from "react-redux";
import styled from "styled-components";
import { data } from '../data/words';
// import uuidv1 from "uuid/v1";
import { data } from "../data/words";
import { puzzleSolver } from "../helpers/puzzleSolver";

const MainResultsDiv = styled.div`
height: 100vh;
min-height: 100vh;
width: 50vw;
background-color: blue;
color: white;
Expand All @@ -18,11 +18,6 @@ const WordsContainer = styled.div`
`;

class Results extends Component {

componentDidMount() {
console.log(data)
}

renderWords(x, y) {
return (
<WordsContainer>
Expand All @@ -35,12 +30,16 @@ class Results extends Component {
render() {
return (
<MainResultsDiv>
currently we're trying to go from COSY to RINK.
{this.props.words ? (
<div>
{this.renderWords(
{puzzleSolver(
this.props.words.firstWord,
this.props.words.secondWord
)}
this.props.words.secondWord,
data
).map(x => {
return <div key={x}>{x}</div>;
})}
</div>
) : null}
</MainResultsDiv>
Expand Down
Loading

0 comments on commit fd6483e

Please sign in to comment.