diff --git a/package.json b/package.json
index c6d9612..4150c2d 100644
--- a/package.json
+++ b/package.json
@@ -22,7 +22,8 @@
"webpack": "^3.3.0",
"webpack-dev-middleware": "^1.6.1",
"webpack-dev-server": "^2.5.1",
- "webpack-hot-middleware": "^2.10.0"
+ "webpack-hot-middleware": "^2.10.0",
+ "font-awesome": "^4.7.0"
},
"devDependencies": {
"babel-eslint": "^7.2.3",
@@ -42,6 +43,7 @@
"eslint-plugin-import": "^2.7.0",
"eslint-plugin-jsx-a11y": "^6.0.2",
"eslint-plugin-react": "^7.1.0",
+ "file-loader": "^0.11.2",
"node-sass": "^4.5.3",
"react-hot-loader": "^1.3.0",
"react-render": "^1.1.0",
diff --git a/src/app/app.jsx b/src/app/app.jsx
index b1474ec..188676c 100644
--- a/src/app/app.jsx
+++ b/src/app/app.jsx
@@ -1,16 +1,33 @@
-import React from 'react';
-
import './app.scss';
-import { Column, Row, Title, Button } from '../components';
-const onAddClick = (event) => {
-};
+import React, { Component } from 'react';
+
+import { setup } from '../client/setup.js';
+import { Main } from '../ui/Main.jsx';
+
+var app = null;
+
+export const getApp = () => {
+ return app;
+}
-const App = () => (
-
- Contact Book
-
-
-);
+export class App extends Component {
+ componentWillMount(){
+ app = this;
-export default App;
+ this.setState({});
+ }
+ componentDidMount(){
+ setup();
+ this.setState({isAppMounted: true});
+ }
+ render() {
+ return ( this.state.isAppMounted == true ?
+
+ :
+
+ not mounted bro
+
+ );
+ }
+}
\ No newline at end of file
diff --git a/src/app/app.scss b/src/app/app.scss
index c161449..055fe7d 100644
--- a/src/app/app.scss
+++ b/src/app/app.scss
@@ -1,6 +1,40 @@
-.app {
- display: flex;
- flex-direction: column;
- align-items: center;
- width: 100%;
+html {
+ width: 100%;
+ height: 100%;
+ font-family: 'Titillium Web', sans-serif;
+
+ body {
+ width: 100%;
+ height: 100%;
+ margin: 0px;
+
+ #render-target {
+ width: 100%;
+ height: 100%;
+
+ .main {
+ width: 100%;
+ height: 100%;
+ }
+ }
+ }
}
+
+.clickable-block{
+ overflow: hidden;
+ position: relative;
+}
+.clickable-block:hover::after {
+ position:absolute;
+ display:block;
+ z-index: 9;
+ background-color: black;
+ opacity: 0.2;
+ left: 0;
+ top: 0;
+ height: 100%;
+ width: 100%;
+ content: '';
+ cursor: pointer;
+ border-radius: inherit;
+}
\ No newline at end of file
diff --git a/src/client/contacts/manage-contacts.js b/src/client/contacts/manage-contacts.js
new file mode 100644
index 0000000..cf910f1
--- /dev/null
+++ b/src/client/contacts/manage-contacts.js
@@ -0,0 +1,30 @@
+export const addNewContact = function(contact){
+ var contactList = getState()['contactList'];
+ contactList.push(contact);
+ setContactList(contactList);
+}
+
+export const editContact = function(index, contact){
+ var contactList = getState()['contactList'];
+ contactList[index] = contact;
+ setContactList(contactList);
+}
+export const getContactFromIndex = function(index){
+ var contactList = getState()['contactList'];
+ return contactList[index];
+}
+
+export const removeContact = function(index){
+ var contactList = getState()['contactList'];
+ contactList.splice(index, 1)
+ setContactList(contactList);
+}
+
+export const toggleContactFavorite = function(index){
+ var contactList = getState()['contactList'];
+ var contact = contactList[index];
+
+ contact.isFavorite = !contact.isFavorite;
+ contactList[index] = contact;
+ setContactList(contactList);
+}
diff --git a/src/client/router/change-page.js b/src/client/router/change-page.js
new file mode 100644
index 0000000..aaffbea
--- /dev/null
+++ b/src/client/router/change-page.js
@@ -0,0 +1,19 @@
+export const goToHome = function(){
+ setCurrentPage('home');
+}
+
+export const goToContactList = function(){
+ setCurrentPage('contact-list');
+}
+export const goToEditContact = function(contactIndex){
+ setCurrentPage('edit-contact');
+ setCurrentlyViewedContact(contactIndex);
+}
+
+export const goToFavoriteList = function(){
+ setCurrentPage('favorite-list');
+}
+
+export const goToAddNewContact = function(){
+ setCurrentPage('add-new-contact');
+}
diff --git a/src/client/setup.js b/src/client/setup.js
new file mode 100644
index 0000000..797a8c5
--- /dev/null
+++ b/src/client/setup.js
@@ -0,0 +1,5 @@
+import { setupState } from './state/setup-state.js';
+
+export const setup = function(){
+ setupState();
+}
\ No newline at end of file
diff --git a/src/client/state/manage-state.js b/src/client/state/manage-state.js
new file mode 100644
index 0000000..00d06e4
--- /dev/null
+++ b/src/client/state/manage-state.js
@@ -0,0 +1,47 @@
+import { getApp } from '../../app/app.jsx';
+
+export const getState = function(){
+ return getApp().state;
+}
+
+export const setState = function(fields){
+ getApp().setState(fields);
+}
+
+export const setCurrentPage = function(page){
+ setState({ currentPage: page });
+}
+
+export const getCurrentPage = function(){
+ return getState()['currentPage'];
+}
+
+export const setContactList = function(contactList){
+ setState({ contactList: contactList });
+}
+
+export const getContactList = function(){
+ return getState()['contactList'];
+}
+
+export const setCurrentlyViewedContact = function(index){
+ return setState({currentlyViewedContact: index});
+}
+
+export const getCurrentlyViewedContact = function(){
+ return getState()['currentlyViewedContact'];
+}
+
+
+
+window.getState = getState;
+window.setState = setState;
+
+window.setCurrentPage = setCurrentPage;
+window.getCurrentPage = getCurrentPage;
+
+window.setContactList = setContactList;
+window.getContactList = getContactList;
+
+window.setCurrentlyViewedContact = setCurrentlyViewedContact;
+window.getCurrentlyViewedContact = getCurrentlyViewedContact;
\ No newline at end of file
diff --git a/src/client/state/setup-state.js b/src/client/state/setup-state.js
new file mode 100644
index 0000000..56336b5
--- /dev/null
+++ b/src/client/state/setup-state.js
@@ -0,0 +1,10 @@
+import { setState, getState } from './manage-state.js';
+
+export const setupState = function(){
+ setCurrentPage('home');
+ setContactList([
+ {firstName: "Gael", lastName: "Flores", email: "flores.gael@gmail.com", phone: "0123456789", isFavorite: true},
+ {firstName: "Alberto", lastName: "Ronaldo", email: "alberto@gmail.com", phone: "17176789", isFavorite: false},
+ {firstName: "Toto", lastName: "Tata", email: "toto@gmail.com", phone: "0101010101", isFavorite: true}
+ ]);
+};
\ No newline at end of file
diff --git a/src/components/controls/button.jsx b/src/components/controls/button.jsx
deleted file mode 100644
index 2b1a0d9..0000000
--- a/src/components/controls/button.jsx
+++ /dev/null
@@ -1,28 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const resolveButtonLabel = (children, label) => {
- if (typeof children === 'string' && children.length > 0) {
- return children;
- } else if (typeof label === 'string' && label.length > 0) {
- return label;
- }
-
- return 'Label';
-};
-
-const Button = ({ children, label, onClick }) => (
-
-);
-
-Button.propTypes = {
- children: PropTypes.string,
- label: PropTypes.string,
- onClick: PropTypes.func.isRequired
-};
-
-Button.defaultProps = {
- label: null,
- children: null
-};
-
-export default Button;
diff --git a/src/components/controls/icon-button.jsx b/src/components/controls/icon-button.jsx
deleted file mode 100644
index 72692e6..0000000
--- a/src/components/controls/icon-button.jsx
+++ /dev/null
@@ -1,17 +0,0 @@
-import React, { PropTypes } from 'react';
-import Icon from 'react-evil-icons';
-
-const IconButton = ({ icon, onClick }) => (
-
-);
-
-IconButton.propTypes = {
- icon: PropTypes.oneOf([
- 'plus',
- 'heart',
- 'clock'
- ]).isRequired,
- onClick: PropTypes.func.isRequired
-};
-
-export default IconButton;
diff --git a/src/components/controls/index.js b/src/components/controls/index.js
deleted file mode 100644
index 36d4bc7..0000000
--- a/src/components/controls/index.js
+++ /dev/null
@@ -1,4 +0,0 @@
-import IconButton from './icon-button';
-import Button from './button';
-
-export { IconButton, Button };
diff --git a/src/components/grid/box.jsx b/src/components/grid/box.jsx
deleted file mode 100644
index 27a1fa7..0000000
--- a/src/components/grid/box.jsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Box = ({ children, className }) => (
- {children}
-);
-
-Box.propTypes = {
- children: PropTypes.oneOfType([
- PropTypes.element,
- PropTypes.arrayOf(PropTypes.element)
- ]),
- className: PropTypes.string
-};
-
-Box.defaultProps = {
- className: '',
- children: null
-};
-
-export default Box;
diff --git a/src/components/grid/column.jsx b/src/components/grid/column.jsx
deleted file mode 100644
index 294ec56..0000000
--- a/src/components/grid/column.jsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Column = ({ children, className }) => (
- {children}
-);
-
-Column.propTypes = {
- children: PropTypes.oneOfType([
- PropTypes.element,
- PropTypes.arrayOf(PropTypes.element)
- ]),
- className: PropTypes.string
-};
-
-Column.defaultProps = {
- className: '',
- children: null
-};
-
-export default Column;
diff --git a/src/components/grid/grid.scss b/src/components/grid/grid.scss
deleted file mode 100644
index 1c238ae..0000000
--- a/src/components/grid/grid.scss
+++ /dev/null
@@ -1,15 +0,0 @@
-.grid {
- &.box {
- display: flex;
- }
-
- &.vbox {
- display: flex;
- flex-direction: column;
- }
-
- &.hbox {
- display: flex;
- flex-direction: row;
- }
-}
diff --git a/src/components/grid/index.js b/src/components/grid/index.js
deleted file mode 100644
index 1036bca..0000000
--- a/src/components/grid/index.js
+++ /dev/null
@@ -1,7 +0,0 @@
-import './grid.scss';
-
-import Box from './box';
-import Column from './column';
-import Row from './row';
-
-export { Box, Column, Row };
diff --git a/src/components/grid/row.jsx b/src/components/grid/row.jsx
deleted file mode 100644
index 36a4f2d..0000000
--- a/src/components/grid/row.jsx
+++ /dev/null
@@ -1,20 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Row = ({ children, className }) => (
- {children}
-);
-
-Row.propTypes = {
- children: PropTypes.oneOfType([
- PropTypes.element,
- PropTypes.arrayOf(PropTypes.element)
- ]),
- className: PropTypes.string
-};
-
-Row.defaultProps = {
- className: '',
- children: null
-};
-
-export default Row;
diff --git a/src/components/index.js b/src/components/index.js
deleted file mode 100644
index ddadfeb..0000000
--- a/src/components/index.js
+++ /dev/null
@@ -1,5 +0,0 @@
-import './resets.scss';
-
-export { IconButton, Button } from './controls';
-export { Box, Column, Row } from './grid';
-export { Title, Subtitle, Label, Description } from './typography';
diff --git a/src/components/resets.scss b/src/components/resets.scss
deleted file mode 100644
index a4a7089..0000000
--- a/src/components/resets.scss
+++ /dev/null
@@ -1,33 +0,0 @@
-html,
-body {
- font-family: "Aktiv Grotesk", "Arial", sans-serif;
-}
-
-body,
-html,
-div,
-article,
-nav,
-footer,
-aside,
-h1,
-h2,
-h3,
-h4,
-h5,
-h6,
-p,
-span {
- margin: 0;
- border: 0;
- padding: 0;
- font-size: 100%;
-}
-
-div,
-article,
-nav,
-footer,
-aside {
- display: flex;
-}
diff --git a/src/components/typography/description.jsx b/src/components/typography/description.jsx
deleted file mode 100644
index 1c1c394..0000000
--- a/src/components/typography/description.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Description = ({ children, className }) => (
- {children}
-);
-
-Description.propTypes = {
- children: PropTypes.string.isRequired,
- className: PropTypes.string
-};
-
-Description.defaultProps = {
- className: ''
-};
-
-export default Description;
diff --git a/src/components/typography/index.js b/src/components/typography/index.js
deleted file mode 100644
index 52a45b4..0000000
--- a/src/components/typography/index.js
+++ /dev/null
@@ -1,8 +0,0 @@
-import './typography.scss';
-
-import Title from './title';
-import Subtitle from './subtitle';
-import Label from './label';
-import Description from './description';
-
-export { Title, Subtitle, Label, Description };
diff --git a/src/components/typography/label.jsx b/src/components/typography/label.jsx
deleted file mode 100644
index c9b2a25..0000000
--- a/src/components/typography/label.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Label = ({ children, className }) => (
-
-);
-
-Label.propTypes = {
- children: PropTypes.string.isRequired,
- className: PropTypes.string
-};
-
-Label.defaultProps = {
- className: ''
-};
-
-export default Label;
diff --git a/src/components/typography/subtitle.jsx b/src/components/typography/subtitle.jsx
deleted file mode 100644
index 0c95ec8..0000000
--- a/src/components/typography/subtitle.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Subtitle = ({ children, className }) => (
- {children}
-);
-
-Subtitle.propTypes = {
- children: PropTypes.string.isRequired,
- className: PropTypes.string
-};
-
-Subtitle.defaultProps = {
- className: ''
-};
-
-export default Subtitle;
diff --git a/src/components/typography/title.jsx b/src/components/typography/title.jsx
deleted file mode 100644
index 2019925..0000000
--- a/src/components/typography/title.jsx
+++ /dev/null
@@ -1,16 +0,0 @@
-import React, { PropTypes } from 'react';
-
-const Title = ({ children, className }) => (
- {children}
-);
-
-Title.propTypes = {
- children: PropTypes.string.isRequired,
- className: PropTypes.string
-};
-
-Title.defaultProps = {
- className: ''
-};
-
-export default Title;
diff --git a/src/components/typography/typography.scss b/src/components/typography/typography.scss
deleted file mode 100644
index f23fe48..0000000
--- a/src/components/typography/typography.scss
+++ /dev/null
@@ -1,17 +0,0 @@
-.typography {
- &.title {
- font-size: 16pt;
- }
-
- &.subtitle {
- font-size: 14pt;
- }
-
- &.label {
- font-size: 9pt;
- }
-
- &.description {
- font-size: 9pt;
- }
-}
diff --git a/src/index.html b/src/index.html
index 6de1522..1a542ff 100644
--- a/src/index.html
+++ b/src/index.html
@@ -3,9 +3,10 @@
Web App
-
+
- This must be World Wide Web!
+
+