diff --git a/package.json b/package.json index f5f14bf..6a916d2 100644 --- a/package.json +++ b/package.json @@ -42,6 +42,7 @@ "inferno-component": "^3.0.5", "inferno-devtools": "^3.0.5", "marked": "^0.3.6", - "papaparse": "^4.2.0" + "papaparse": "^4.2.0", + "store": "^2.0.4" } } diff --git a/public/logo.svg b/public/logo.svg new file mode 100644 index 0000000..e120050 --- /dev/null +++ b/public/logo.svg @@ -0,0 +1,3 @@ + + +image/svg+xml diff --git a/src/Helper.js b/src/Helper.js new file mode 100644 index 0000000..ff0496b --- /dev/null +++ b/src/Helper.js @@ -0,0 +1,13 @@ +class Helper { + constructor () { + this.addHelpfulPrototypes(); + } + + addHelpfulPrototypes () { + String.prototype.capitalize = function() { + return this.charAt(0).toUpperCase() + this.slice(1); + } + } +} + +export default new Helper; diff --git a/src/components/Lexiconga.jsx b/src/components/Lexiconga.jsx deleted file mode 100644 index a22f2c3..0000000 --- a/src/components/Lexiconga.jsx +++ /dev/null @@ -1,45 +0,0 @@ -import Inferno from 'inferno'; -import Component from 'inferno-component'; - -import {LeftColumn} from './structure/LeftColumn'; -import {RightColumn} from './structure/RightColumn'; - -import {WordForm} from './management/WordForm'; -import {DictionaryDetails} from './display/DictionaryDetails'; - -export class Lexiconga extends Component { - constructor (props) { - super(props); - } - - render () { - return ( -
-
-
- - - - - - - - - -
-
-
- ); - } -} diff --git a/src/components/MainDisplay.jsx b/src/components/MainDisplay.jsx new file mode 100644 index 0000000..4756814 --- /dev/null +++ b/src/components/MainDisplay.jsx @@ -0,0 +1,40 @@ +import Inferno from 'inferno'; + +import {LeftColumn} from './structure/LeftColumn'; +import {RightColumn} from './structure/RightColumn'; + +import {WordForm} from './management/WordForm'; +import {DictionaryDetails} from './display/DictionaryDetails'; + +export const MainDisplay = ({dictionaryInfo}) => { + return ( +
+
+
+ + + + + + + + + +
+
+
+ ); +} diff --git a/src/components/display/DictionaryDetails.jsx b/src/components/display/DictionaryDetails.jsx index 4445b27..66f39b2 100644 --- a/src/components/display/DictionaryDetails.jsx +++ b/src/components/display/DictionaryDetails.jsx @@ -139,7 +139,7 @@ export class DictionaryDetails extends Component {

- Dictionary Name + {this.props.name} {this.props.specification}

diff --git a/src/components/management/SearchBox.jsx b/src/components/management/SearchBox.jsx index 5be56df..115a541 100644 --- a/src/components/management/SearchBox.jsx +++ b/src/components/management/SearchBox.jsx @@ -1,6 +1,10 @@ import Inferno from 'inferno'; import Component from 'inferno-component'; +import Helper from '../../Helper'; + +import dictionary from '../../managers/DictionaryData'; + export class SearchBox extends Component { constructor (props) { super(props); @@ -8,11 +12,23 @@ export class SearchBox extends Component { this.state = { searchingIn: 'name' , searchTerm: '' + , filteredPartsOfSpeech: [] , showHeader: false , showAdvanced: false }; } + search () { + const {searchingIn, searchTerm, filteredPartsOfSpeech} = this.state; + const searchConfig = { + searchingIn + , searchTerm + , filteredPartsOfSpeech + }; + + this.props.search(searchConfig); + } + displaySearchHeader () { if (this.state.showHeader) { return ( @@ -31,7 +47,6 @@ export class SearchBox extends Component { + Contains + + + +

+ +
+

+ + Contains:  + Search term is anywhere within the {this.state.searchingIn.capitalize()} + + + Starts With:  + The {this.state.searchingIn.capitalize()} begins with the search term + + + Exact:  + Search term matches the {this.state.searchingIn.capitalize()} exactly + +

+
+ + + ) + : null; + + const filterSectionJSX = (
- {this.props.partsOfSpeech.map((partOfSpeech) => { + {dictionary.partsOfSpeech.map((partOfSpeech) => { return (

+ {searchMethodSectionJSX} {filterSectionJSX}
@@ -108,7 +167,7 @@ export class SearchBox extends Component {

- this.setState({showAdvanced: !this.state.showAdvanced})}> Advanced diff --git a/src/components/structure/Footer.jsx b/src/components/structure/Footer.jsx index 6abc20b..4004f4d 100644 --- a/src/components/structure/Footer.jsx +++ b/src/components/structure/Footer.jsx @@ -1,50 +1,43 @@ import Inferno from 'inferno'; -import Component from 'inferno-component'; -export class Footer extends Component { - constructor (props) { - super(props); - } - - render () { - return ( -

+ ); } diff --git a/src/components/structure/Header.jsx b/src/components/structure/Header.jsx index fd4605f..a3313c9 100644 --- a/src/components/structure/Header.jsx +++ b/src/components/structure/Header.jsx @@ -6,6 +6,10 @@ import {SearchBox} from '../management/SearchBox'; export class Header extends Component { constructor (props) { super(props); + + this.state = { + displayNavMenu: false + } } render () { @@ -13,24 +17,25 @@ export class Header extends Component {