diff --git a/public/components/page/Page.jsx b/public/components/page/Page.jsx index f5ce5cf..a807e3d 100644 --- a/public/components/page/Page.jsx +++ b/public/components/page/Page.jsx @@ -24,50 +24,34 @@ import React from 'react'; import { connect } from 'react-redux'; import { Helmet } from "react-helmet"; +import { withLanguage } from '@public/language/Language'; import Styles from './Page.scss'; -//Publics -import Language from '@public/language/Language'; - //Components import PageBoundary from './boundary/PageBoundary'; -class Page extends React.Component { - constructor(props) { - super(props); +export default withLanguage(props => { + let { title, style, className, lang, children } = props; + + let clazzes = `c-page ${className||""}`; + + let titleHelmet; + if((!title || !title.length) && style != "home-page") { + console.exception(`This page (${style||className}) does not have a title!`); + } else { + titleHelmet = { title } } - render() { - let { title, style, className } = this.props; - - let clazzes = `c-page ${className||""}`; - - let titleHelmet; - if((!title || !title.length) && style != "home-page") { - console.exception(`This page (${style||className}) does not have a title!`); - } else { - titleHelmet = { this.props.title } - } - - return ( -
- - { titleHelmet } - - { this.props.children } -
- ); - } -} - -const mapStateToProps = function(state) { - return { - code: state.language.code - } -} - -export default connect(mapStateToProps)(Page); + return ( +
+ + { titleHelmet } + + { children } +
+ ); +}); export { PageBoundary diff --git a/public/components/page/boundary/PageBoundary.jsx b/public/components/page/boundary/PageBoundary.jsx index a4d78cb..667448c 100644 --- a/public/components/page/boundary/PageBoundary.jsx +++ b/public/components/page/boundary/PageBoundary.jsx @@ -29,13 +29,12 @@ export default (props) => { let newProps = { ...props }; let { full, small, className } = props; - delete newProps.full; - delete newProps.small; + ["full","small"].forEach(e => delete newProps[e]); let clazzes = "c-page-boundary"; - if(props.full) clazzes += " is-full"; - if(props.small) clazzes += " is-small"; - if(props.className) clazzes += " " + props.className; + if(full) clazzes += " is-full"; + if(small) clazzes += " is-small"; + if(className) clazzes += ` ${className}` return (
diff --git a/public/components/page/error/ErrorPage.jsx b/public/components/page/error/ErrorPage.jsx index e967cd6..b2da43c 100644 --- a/public/components/page/error/ErrorPage.jsx +++ b/public/components/page/error/ErrorPage.jsx @@ -22,12 +22,13 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; +import { withLanguage} from '@public/language/Language'; -export default props => { - let { className } = props; +export default withLanguage(props => { + let { className, lang } = props; return ( - - An error occured! Try again later. + +

{ lang.pages.error.body }

); -}; +}); diff --git a/public/components/page/loading/LoadingPage.jsx b/public/components/page/loading/LoadingPage.jsx index c64cc96..b1e8c81 100644 --- a/public/components/page/loading/LoadingPage.jsx +++ b/public/components/page/loading/LoadingPage.jsx @@ -22,6 +22,7 @@ // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. import React from 'react'; +import { withLanguage } from '@public/language/Language'; import Styles from './LoadingPage.scss'; @@ -29,12 +30,12 @@ import Page from '@components/Page/Page'; import Loader from '@objects/loading/Loader'; -export default props => { - let { className } = props; - +export default withLanguage(props => { + let { className, lang } = props; + return ( - + ); -}; +}); diff --git a/public/components/section/Section.jsx b/public/components/section/Section.jsx index e66d308..7e128d3 100644 --- a/public/components/section/Section.jsx +++ b/public/components/section/Section.jsx @@ -25,7 +25,7 @@ import React from 'react'; import Styles from './Section.scss'; -export default (props) => { +export default props => { let newProps = {...props}; let { full, className, children } = props; @@ -35,9 +35,7 @@ export default (props) => { if(full) clazz += " is-full"; if(className) clazz += ` ${className}`; - return ( -
- ); + return
; } import BodySection from './body/BodySection'; diff --git a/public/components/section/body/BodySection.jsx b/public/components/section/body/BodySection.jsx index 215b5be..f828473 100644 --- a/public/components/section/body/BodySection.jsx +++ b/public/components/section/body/BodySection.jsx @@ -27,11 +27,4 @@ import Styles from './BodySection.scss'; import Section from './../Section'; -export default function(props) { - let clazz = "c-body-section"; - if(props.className) clazz += ` ${props.className}`; - - return ( -
- ); -}; +export default props =>
; diff --git a/public/components/section/layout/ClearSection.jsx b/public/components/section/layout/ClearSection.jsx index b803caf..6c074f6 100644 --- a/public/components/section/layout/ClearSection.jsx +++ b/public/components/section/layout/ClearSection.jsx @@ -27,8 +27,4 @@ import Styles from './ClearSection.scss'; import Section from './../Section'; -export default (props) => { - let clazz = "c-clear-section"; - if(props.className) clazz += " " + props.className; - return
; -}; +export default props =>
; diff --git a/public/components/section/layout/SplitSection.jsx b/public/components/section/layout/SplitSection.jsx index 5aead6e..81008f5 100644 --- a/public/components/section/layout/SplitSection.jsx +++ b/public/components/section/layout/SplitSection.jsx @@ -29,31 +29,27 @@ import Section from './../Section'; export default (props) => { let { align, className } = props; - let newProps = {...props}; - align = align || "stretched"; let clazz = "c-split-section is-" + align; if(className) clazz += ` ${className}`; return ( -
+
) }; -const Split = function(props) { +const Split = props => { + let newProps = {...props}; let { padded, className, children } = props; - let clazz = "c-split-section__split"; + ["padded"].forEach(e => delete newProps[e]); + let clazz = "c-split-section__split"; if(padded) clazz += " is-padded"; if(className) clazz += ` ${className}`; - return ( -
- { children } -
- ); + return
; } diff --git a/public/components/section/video/VideoSection.jsx b/public/components/section/video/VideoSection.jsx index 6bd23df..4dd29ed 100644 --- a/public/components/section/video/VideoSection.jsx +++ b/public/components/section/video/VideoSection.jsx @@ -31,24 +31,19 @@ import Video from '@objects/video/Video'; import Loader from '@objects/loading/Loader'; export default (props) => { - let { full, className, sources } = props; + let { full, className, sources, children } = props; let videoProps = {...props}; let sectionProps = {...props}; - - [ - "autoPlay", "fill", "loop", "sources" - ].forEach(e => delete sectionProps[e]); - - delete videoProps.children; + [ "autoPlay", "fill", "loop", "sources" ].forEach(e => delete sectionProps[e]); + [ "children" ].forEach(e => delete videoProps[e]); if(typeof props.autoPlay === typeof undefined) props.autoPlay = true; if(typeof props.loop === typeof undefined) props.loop = true; if(typeof props.fill === typeof undefined) props.fill = true; - return ( -
+
diff --git a/public/language/en-AU.jsx b/public/language/en-AU.jsx index 224e4e8..e99e31f 100644 --- a/public/language/en-AU.jsx +++ b/public/language/en-AU.jsx @@ -204,6 +204,15 @@ export default { "title": "Privacy Policy", "heading": "Privacy Policy", "policy": Policy + }, + + "error": { + "title": "Uh-Oh!", + "body": "An error occured! Try again later." + }, + + "loading": { + "title": "Please Wait..." } },