Skip to content

Commit

Permalink
Added Material and simple functional stepper
Browse files Browse the repository at this point in the history
  • Loading branch information
Rafael committed Mar 7, 2021
1 parent f3b9a4d commit 0d9ebed
Show file tree
Hide file tree
Showing 9 changed files with 362 additions and 22 deletions.
219 changes: 219 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@material-ui/core": "^4.11.3",
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.5.0",
"@testing-library/user-event": "^7.2.1",
Expand Down
11 changes: 7 additions & 4 deletions src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,24 +1,27 @@
import React from "react";
import "./App.css";

import { Provider } from "react-redux";
import { createStore, Reducer, Action } from "redux";
import GlobalState, { initialState } from "./state/globalState";

import Header from "./styledComponents/Header";
import Central from "./styledComponents/Central";
import Footer from "./styledComponents/Footer";
import Carousel from "./styledComponents/Carousel";
import { CentralActions, StepAction } from "./actions/CentralActions";

const reducer: Reducer<GlobalState, Action> = (
const reducer: Reducer<GlobalState, StepAction> = (
state: GlobalState = initialState,
action: Action
action: StepAction
) => {
if (action.type === CentralActions.CHANGE_STEP) {
return { ...state, current: action.payload };
}
return state;
};
const store = createStore(reducer, initialState);

function App() {
console.log(store.getState());
return (
<Provider store={store}>
<div id="contenedor">
Expand Down
9 changes: 9 additions & 0 deletions src/actions/CentralActions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { Action } from "redux";

export enum CentralActions {
CHANGE_STEP = "CHANGE_STEP",
}

export interface StepAction extends Action {
payload: number;
}
Loading

0 comments on commit 0d9ebed

Please sign in to comment.