From 49520d6e627e49a1f9f1b8cfa9b323450307fcc6 Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Wed, 24 Aug 2016 17:56:44 +0200 Subject: Adding React.js, Redux, revamping dashboard --- .../javascripts/components/components/column.jsx | 19 +++++++++++++++++++ .../components/components/column_header.jsx | 15 +++++++++++++++ .../components/components/columns_area.jsx | 15 +++++++++++++++ .../javascripts/components/components/frontend.jsx | 16 ++++++++++++++++ .../javascripts/components/components/nav_bar.jsx | 8 ++++++++ .../javascripts/components/components/status.jsx | 19 +++++++++++++++++++ .../components/components/status_list.jsx | 22 ++++++++++++++++++++++ 7 files changed, 114 insertions(+) create mode 100644 app/assets/javascripts/components/components/column.jsx create mode 100644 app/assets/javascripts/components/components/column_header.jsx create mode 100644 app/assets/javascripts/components/components/columns_area.jsx create mode 100644 app/assets/javascripts/components/components/frontend.jsx create mode 100644 app/assets/javascripts/components/components/nav_bar.jsx create mode 100644 app/assets/javascripts/components/components/status.jsx create mode 100644 app/assets/javascripts/components/components/status_list.jsx (limited to 'app/assets/javascripts/components/components') diff --git a/app/assets/javascripts/components/components/column.jsx b/app/assets/javascripts/components/components/column.jsx new file mode 100644 index 000000000..c585b6b0b --- /dev/null +++ b/app/assets/javascripts/components/components/column.jsx @@ -0,0 +1,19 @@ +import StatusListContainer from '../containers/status_list_container'; +import ColumnHeader from './column_header'; + +const Column = React.createClass({ + propTypes: { + type: React.PropTypes.string + }, + + render: function() { + return ( +
+ + +
+ ); + } +}); + +export default Column; diff --git a/app/assets/javascripts/components/components/column_header.jsx b/app/assets/javascripts/components/components/column_header.jsx new file mode 100644 index 000000000..e2f7d7c1c --- /dev/null +++ b/app/assets/javascripts/components/components/column_header.jsx @@ -0,0 +1,15 @@ +const ColumnHeader = React.createClass({ + propTypes: { + type: React.PropTypes.string + }, + + render: function() { + return ( +
+ {this.props.type} +
+ ); + } +}); + +export default ColumnHeader; diff --git a/app/assets/javascripts/components/components/columns_area.jsx b/app/assets/javascripts/components/components/columns_area.jsx new file mode 100644 index 000000000..1c46f722d --- /dev/null +++ b/app/assets/javascripts/components/components/columns_area.jsx @@ -0,0 +1,15 @@ +import Column from './column'; + +const ColumnsArea = React.createClass({ + + render: function() { + return ( +
+ + +
+ ); + } +}); + +export default ColumnsArea; diff --git a/app/assets/javascripts/components/components/frontend.jsx b/app/assets/javascripts/components/components/frontend.jsx new file mode 100644 index 000000000..6f9c46fa9 --- /dev/null +++ b/app/assets/javascripts/components/components/frontend.jsx @@ -0,0 +1,16 @@ +import NavBar from './nav_bar'; +import ColumnsArea from './columns_area'; + +const Frontend = React.createClass({ + + render: function() { + return ( +
+ + +
+ ); + } +}); + +export default Frontend; diff --git a/app/assets/javascripts/components/components/nav_bar.jsx b/app/assets/javascripts/components/components/nav_bar.jsx new file mode 100644 index 000000000..1ece3cc34 --- /dev/null +++ b/app/assets/javascripts/components/components/nav_bar.jsx @@ -0,0 +1,8 @@ +const NavBar = React.createClass({ + + render: function() { + return
; + } +}); + +export default NavBar; diff --git a/app/assets/javascripts/components/components/status.jsx b/app/assets/javascripts/components/components/status.jsx new file mode 100644 index 000000000..9bbb02077 --- /dev/null +++ b/app/assets/javascripts/components/components/status.jsx @@ -0,0 +1,19 @@ +import ImmutablePropTypes from 'react-immutable-proptypes'; + +const Status = React.createClass({ + propTypes: { + status: ImmutablePropTypes.map.isRequired + }, + + render: function() { + console.log(this.props.status.toJS()); + + return ( +
+ {this.props.status.getIn(['account', 'username'])}: {this.props.status.get('content')} +
+ ); + } +}); + +export default Status; diff --git a/app/assets/javascripts/components/components/status_list.jsx b/app/assets/javascripts/components/components/status_list.jsx new file mode 100644 index 000000000..c986c773b --- /dev/null +++ b/app/assets/javascripts/components/components/status_list.jsx @@ -0,0 +1,22 @@ +import Status from './status'; +import ImmutablePropTypes from 'react-immutable-proptypes'; + +const StatusList = React.createClass({ + propTypes: { + statuses: ImmutablePropTypes.list.isRequired + }, + + render: function() { + return ( +
+
+ {this.props.statuses.map((status) => { + return ; + })} +
+
+ ); + } +}); + +export default StatusList; -- cgit