add static pages
This commit is contained in:
parent
bd78b8e4d7
commit
5ba5100a52
19 changed files with 320 additions and 7 deletions
44
imports/ui/pages/Page/Page.js
Normal file
44
imports/ui/pages/Page/Page.js
Normal file
|
|
@ -0,0 +1,44 @@
|
|||
import React from 'react';
|
||||
import PropTypes from 'prop-types';
|
||||
import { Meteor } from 'meteor/meteor';
|
||||
import { createContainer } from 'meteor/react-meteor-data';
|
||||
import { ReactiveVar } from 'meteor/reactive-var';
|
||||
import PageHeader from '../../components/PageHeader/PageHeader';
|
||||
import Content from '../../components/Content/Content';
|
||||
|
||||
import './Page.scss';
|
||||
|
||||
const Page = ({ title, subtitle, content }) => (
|
||||
<div className="Page">
|
||||
<PageHeader title={title} subtitle={subtitle} />
|
||||
<Content content={content} />
|
||||
</div>
|
||||
);
|
||||
|
||||
Page.defaultProps = {
|
||||
subtitle: '',
|
||||
};
|
||||
|
||||
Page.propTypes = {
|
||||
title: PropTypes.string.isRequired,
|
||||
subtitle: PropTypes.string,
|
||||
content: PropTypes.string.isRequired,
|
||||
};
|
||||
|
||||
const pageContent = new ReactiveVar('');
|
||||
|
||||
export default createContainer(({ content, page }) => {
|
||||
window.scrollTo(0, 0); // Force window to top of page.
|
||||
|
||||
Meteor.call('utility.getPage', page, (error, response) => {
|
||||
if (error) {
|
||||
console.warn(error);
|
||||
} else {
|
||||
pageContent.set(response);
|
||||
}
|
||||
});
|
||||
|
||||
return {
|
||||
content: content || pageContent.get(),
|
||||
};
|
||||
}, Page);
|
||||
11
imports/ui/pages/Page/Page.scss
Normal file
11
imports/ui/pages/Page/Page.scss
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
@import '../../stylesheets/mixins';
|
||||
|
||||
.Page {
|
||||
margin-bottom: 0px;
|
||||
}
|
||||
|
||||
@include breakpoint(tablet) {
|
||||
.Page {
|
||||
margin-bottom: 30px;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue