Skip to content

Commit

Permalink
Basic structure.
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha Becker committed Apr 20, 2016
1 parent 9b28798 commit 618de6e
Show file tree
Hide file tree
Showing 43 changed files with 1,610 additions and 0 deletions.
7 changes: 7 additions & 0 deletions .babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"presets": [
"meteor"
],
"plugins": [
]
}
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
.idea
node_modules
13 changes: 13 additions & 0 deletions .meteor/.finished-upgraders
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# This file contains information which helps Meteor properly upgrade your
# app when you run 'meteor update'. You should check it into version control
# with your project.

notices-for-0.9.0
notices-for-0.9.1
0.9.4-platform-file
notices-for-facebook-graph-api-2
1.2.0-standard-minifiers-package
1.2.0-meteor-platform-split
1.2.0-cordova-changes
1.2.0-breaking-changes
1.3.0-split-minifiers-package
1 change: 1 addition & 0 deletions .meteor/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
local
7 changes: 7 additions & 0 deletions .meteor/.id
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file contains a token that is unique to your project.
# Check it into your repository along with the rest of this directory.
# It can be used for purposes such as:
# - ensuring you don't accidentally deploy one app on top of another
# - providing package authors with aggregated statistics

jtrb9d5dyqx14nvzjk
24 changes: 24 additions & 0 deletions .meteor/packages
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Meteor packages used by this project, one per line.
# Check this file (and the other files in this directory) into your repository.
#
# 'meteor add' and 'meteor remove' will edit this file for you,
# but you can also edit it by hand.

meteor-base # Packages every Meteor app needs to have
mobile-experience # Packages for a great mobile UX
mongo # The database Meteor supports right now
blaze-html-templates # Compile .html files into Meteor Blaze views
session # Client-side reactive dictionary for your app
jquery # Helpful client-side library
tracker # Meteor's client-side reactive programming library

es5-shim # ECMAScript 5 compatibility for older browsers.
gadicc:ecmascript-hot # Enable ECMAScript2015+ syntax in app code

accounts-password
constellation:console
kadira:dochead
random
standard-minifier-js
standard-minifier-css
kadira:flow-router
2 changes: 2 additions & 0 deletions .meteor/platforms
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
server
browser
1 change: 1 addition & 0 deletions .meteor/release
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[email protected]
95 changes: 95 additions & 0 deletions .meteor/versions
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
[email protected]
[email protected]
aldeed:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
babrahams:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
constellation:[email protected]
cosmos:[email protected]
dburles:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
gadicc:[email protected]_1
gadicc:[email protected]_1
gadicc:[email protected]
gadicc:[email protected]
gadicc:[email protected]_2
[email protected]
gwendall:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
kadira:[email protected]
kadira:[email protected]
lai:[email protected]_1
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
meteorhacks:[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]_2
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
[email protected]
11 changes: 11 additions & 0 deletions .storybook/config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
import { configure } from '@kadira/storybook';
import { disable } from 'react-komposer';

disable();

function loadStories() {
require('../client/modules/core/components/.stories');
// require as many as .stories you need.
}

configure(loadStories, module);
20 changes: 20 additions & 0 deletions client/.babelrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"extends": "../.babelrc",

"env": {
"development": {
"plugins": [
["react-transform", {
"transforms": [{
"transform": "react-transform-hmr",
"imports": ["react"],
"locals": ["module"]
}, {
"transform": "react-transform-catch-errors",
"imports": ["react", "redbox-react"]
}]
}]
]
}
}
}
16 changes: 16 additions & 0 deletions client/configs/context.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import { Meteor } from 'meteor/meteor';
import { Tracker } from 'meteor/tracker';
import { FlowRouter } from 'meteor/kadira:flow-router';
// Redux
import { createStore } from 'redux';

const defaultState = { time: new Date().toString() };

export default function ({ reducer }) {
return {
Meteor,
Tracker,
FlowRouter,
Store: createStore(reducer, defaultState),
};
}
39 changes: 39 additions & 0 deletions client/main.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
import { createApp } from 'mantra-core';
import initContext from './configs/context';

// Redux
import { combineReducers } from 'redux';

// Modules
import coreModule from './modules/core';
//import userModule from './modules/user';

import injectTapEventPlugin from 'react-tap-event-plugin';
injectTapEventPlugin();

const coreReducers = coreModule.reducer;
//const userReducers = userModule.reducer;

// Combine Reducers
const reducer = combineReducers({
...coreReducers,
//...userReducers,
});

console.log("coreModule Reducer");
console.log(coreModule.reducer);

console.log("combined reducer");
console.log(reducer);

// Init Context
const context = initContext({ reducer });

console.log("context");
console.log(context);

// Create App
const app = createApp(context);
app.loadModule(coreModule);
// app.loadModule(userModule);
app.init();
17 changes: 17 additions & 0 deletions client/modules/core/actions/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
const SET_USER = 'SET_USER';
const MENU_TOGGLE = 'MENU_TOGGLE';
const SNACKBAR_TOGGLE = 'SNACKBAR_TOGGLE';

export const post = {
setUser(user) {
return { type: SET_USER, user };
},
toggleMenu(open) {
console.log("togglemenu action");
console.log(open);
return { type: MENU_TOGGLE, open };
},
toggleSnackbar(open) {
return { type: SNACKBAR_TOGGLE, open };
},
};
1 change: 1 addition & 0 deletions client/modules/core/components/.stories/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
//import './test';
67 changes: 67 additions & 0 deletions client/modules/core/components/DefaultToolbar.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
import React from 'react';
import AppBar from 'material-ui/AppBar';
import { useDeps } from 'mantra-core';

const styles = {
content: {
// position: "fixed",
// minHeight: 0,
height: 300,
backgroundSize: 'cover',
backgroundPosition: '50% 50%',
backgroundImage: 'url(http://lorempixel.com/1600/300/nature)',
},
title: {},
};

class DefaultToolbarImpl extends React.Component {
constructor(props) {
super(props);
this.state = {
mobileView: window.innerWidth < 1024,
};

this.handleResize = () => {
this.setState({
mobileView: window.innerWidth < 1024,
});
};
}

componentDidMount() {
window.addEventListener('resize', this.handleResize);
}

componentWillUnmount() {
window.removeEventListener('resize', this.handleResize);
}

toggleMenu() {
console.log(this.props.menuOpen);
if (this.state.mobileView) {
this.props.store.dispatch(this.props.toggleMenu(this.props.menuOpen));
}
}

render() {
return (
<div>
<AppBar
style={styles.content}
title={this.props.title}
titleStyle={styles.title}
onLeftIconButtonTouchTap={() => this.toggleMenu()}
showMenuIconButton={this.state.mobileView}
/>
</div>
);
}
}

const depsToPropsMapper = (context, actions) => ({
menuOpen: context.Store.getState().menu.menuOpen,
store: context.Store,
toggleMenu: actions.post.toggleMenu,
});

export const DefaultToolbar = useDeps(depsToPropsMapper)(DefaultToolbarImpl);
41 changes: 41 additions & 0 deletions client/modules/core/components/Home.jsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
import React from 'react';

export class Home extends React.Component {
constructor(props) {
super(props);
}

render() {
return (
<div className="home">
<h1>HTML Ipsum Presents</h1>

<p><strong>Pellentesque habitant morbi tristique</strong> senectus et netus et malesuada fames ac turpis
egestas. Vestibulum tortor quam, feugiat vitae, ultricies eget, tempor sit amet, ante. Donec eu libero sit
amet quam egestas semper. <em>Aenean ultricies mi vitae est.</em> Mauris placerat eleifend leo. Quisque sit
amet est et sapien ullamcorper pharetra. Vestibulum erat wisi, condimentum sed, <code>commodo vitae</code>,
ornare sit amet, wisi. Aenean fermentum, elit eget tincidunt condimentum, eros ipsum rutrum orci, sagittis
tempus lacus enim ac dui. <a href="#">Donec non enim</a> in turpis pulvinar facilisis. Ut felis.</p>

<h2>Header Level 2</h2>

<ol>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ol>

<blockquote><p>Lorem ipsum dolor sit amet, consectetur adipiscing elit. Vivamus magna. Cras in mi at felis
aliquet congue. Ut a est eget ligula molestie gravida. Curabitur massa. Donec eleifend, libero at sagittis
mollis, tellus est malesuada tellus, at luctus turpis elit sit amet quam. Vivamus pretium ornare est.</p>
</blockquote>

<h3>Header Level 3</h3>

<ul>
<li>Lorem ipsum dolor sit amet, consectetuer adipiscing elit.</li>
<li>Aliquam tincidunt mauris eu risus.</li>
</ul>
</div>
);
}
}
Loading

0 comments on commit 618de6e

Please sign in to comment.