Skip to content

Commit

Permalink
pre-setup for Mike Redux lecture
Browse files Browse the repository at this point in the history
  • Loading branch information
Universe-Man committed Jul 23, 2018
1 parent daa1c1a commit 01b0c4d
Show file tree
Hide file tree
Showing 12 changed files with 55 additions and 173 deletions.
2 changes: 1 addition & 1 deletion src/App.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React, { Component } from 'react';
import logo from './logo.svg';
import './App.css';
import './assets/App.css';
import GodContainer from './containers/GodContainer';

class App extends Component {
Expand Down
9 changes: 0 additions & 9 deletions src/App.test.js

This file was deleted.

File renamed without changes.
File renamed without changes.
3 changes: 1 addition & 2 deletions src/components/Header.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import '../App.css';

import '../assets/App.css';

class Header extends React.Component {
constructor(){
Expand Down
2 changes: 1 addition & 1 deletion src/components/Login.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import React from 'react';
import { Button, Checkbox, Form } from 'semantic-ui-react'
import '../App.css';
import '../assets/App.css';

class Login extends React.Component {
constructor(){
Expand Down
2 changes: 1 addition & 1 deletion src/components/Profile.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import '../App.css';
import '../assets/App.css';
import { Container, Divider } from 'semantic-ui-react'


Expand Down
2 changes: 1 addition & 1 deletion src/components/SearchBar.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import '../App.css';
import '../assets/App.css';

class SearchBar extends React.Component {
constructor(){
Expand Down
2 changes: 1 addition & 1 deletion src/containers/GodContainer.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react';
import Header from '../components/Header';
import DisplayContainer from '../containers/DisplayContainer';
import '../App.css';
import '../assets/App.css';

class GodContainer extends React.Component {
constructor(){
Expand Down
3 changes: 1 addition & 2 deletions src/containers/ResultsList.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React from 'react';
import '../App.css';

import '../assets/App.css';

const ResultsList = (props) => {
return(
Expand Down
86 changes: 48 additions & 38 deletions src/index.js
Original file line number Diff line number Diff line change
@@ -1,48 +1,58 @@
import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import './assets/index.css';
import App from './App';
import registerServiceWorker from './registerServiceWorker';

import 'semantic-ui-css/semantic.min.css';

import { combineReducers, createStore } from 'redux';

function usersReducer(state = [], action){
return state;
}

function teamsReducer(state = '', action){
switch (action.type) {
case 'UPDATE_TEAM':
return action.payload;
}
return state;
}

const allReducers = combineReducers({
users: usersReducer,
teams: teamsReducer
})
const store = createStore(
allReducers,
{
users: [{name: "Ian"}],
teams: "The Best Team"
},
window.devToolsExtension && window.devToolsExtension()
);

console.log(store.getState());

const updateTeamAction = {
type: 'UPDATE_TEAM',
payload: {
teams: "The Worst Team"
}
};

store.dispatch(updateTeamAction)

ReactDOM.render(<App />, document.getElementById('root'));
registerServiceWorker();















///////OLD REDUX SETUP/////////
//
// function usersReducer(state = [], action){
// return state;
// }
// function teamsReducer(state = '', action){
// switch (action.type) {
// case 'UPDATE_TEAM':
// return action.payload;
// }
// return state;
// }
// const allReducers = combineReducers({
// users: usersReducer,
// teams: teamsReducer
// })
// const store = createStore(
// allReducers,
// {
// users: [{name: "Ian"}],
// teams: "The Best Team"
// },
// window.devToolsExtension && window.devToolsExtension()
// );
// console.log(store.getState());
// const updateTeamAction = {
// type: 'UPDATE_TEAM',
// payload: {
// teams: "The Worst Team"
// }
// };
// store.dispatch(updateTeamAction)
117 changes: 0 additions & 117 deletions src/registerServiceWorker.js

This file was deleted.

0 comments on commit 01b0c4d

Please sign in to comment.