diff --git a/src/components/Dictionary.jsx b/src/components/Dictionary.jsx index 4165e89..a00e99b 100644 --- a/src/components/Dictionary.jsx +++ b/src/components/Dictionary.jsx @@ -1,6 +1,5 @@ import React from 'react'; -import {Word} from './Word'; import {Button} from './Button'; export class Dictionary extends React.Component { @@ -8,61 +7,20 @@ export class Dictionary extends React.Component { super(props); this.state = { - dictionary: this.props.reference, - name: this.props.reference.name, - description: this.props.reference.description, - createdBy: this.props.reference.createdBy, - words: this.props.reference.words, - nextWordId: this.props.reference.nextWordId, - externalID: this.props.reference.externalID, - allowDuplicates: this.props.reference.settings.allowDuplicates, - caseSensitive: this.props.reference.settings.caseSensitive, - partsOfSpeech: this.props.reference.settings.partOfSpeech, - sortByEquivalent: this.props.reference.settings.sortByEquivalent, - isComplete: this.props.reference.settings.isComplete, - isPublic: this.props.reference.settings.isPublic + // name: this.props.reference.name, + // description: this.props.reference.description, + // createdBy: this.props.reference.createdBy, + // nextWordId: this.props.reference.nextWordId, + // externalID: this.props.reference.externalID, + // allowDuplicates: this.props.reference.settings.allowDuplicates, + // caseSensitive: this.props.reference.settings.caseSensitive, + // partsOfSpeech: this.props.reference.settings.partOfSpeech, + // sortByEquivalent: this.props.reference.settings.sortByEquivalent, + // isComplete: this.props.reference.settings.isComplete, + // isPublic: this.props.reference.settings.isPublic + dictionary: this.props.parent.state.details, + settings: this.props.parent.state.settings } - - // this.addTestWord(); - } - - showWords() { - let words = this.state.words.map((word, index) => { - return ; - // return ; - }); - - return
{words}
; - } - - addTestWord() { - this.setState({ - words: this.state.words.concat([{ - name: 'word', - pronunciation: 'pronunciation', - partOfSpeech: 'partOfSpeech', - simpleDefinition: 'simpleDefinition', - longDefinition: 'longDefinition', - wordId: 'wordId' - }]) - }, () => console.log(this.state.words)); - } - - changeNameAgain() { - let updateDictionary = this.state.dictionary; - updateDictionary.name = 'something else again' - this.setState({ - dictionary: updateDictionary - }) } render() { @@ -73,27 +31,21 @@ export class Dictionary extends React.Component {

- {this.state.createdBy} + {this.state.dictionary.createdBy}

- Dictionary is complete: {this.state.isComplete.toString()} + Dictionary is complete: {this.state.settings.isComplete.toString()}
- {this.showWords()} + {this.props.children}
-