diff --git a/src/components/Calendar/Day.js b/src/components/Calendar/Day.js index 6182cda..8f49fa1 100644 --- a/src/components/Calendar/Day.js +++ b/src/components/Calendar/Day.js @@ -120,7 +120,6 @@ export default function Day(props) { {/* */} - {/* */} {/* style={{ width: '60px' }} */} @@ -129,7 +128,7 @@ export default function Day(props) { secondary={`${firstWorkout()} & ${secondWorkout()}`} // Workouts: /> */} - + {`Day ${day.day}, ${second}`}

{ Week 1 - + {/* */} {week.map(day => ( diff --git a/src/components/Video/Video.js b/src/components/Video/Video.js index c4abe86..587e2be 100644 --- a/src/components/Video/Video.js +++ b/src/components/Video/Video.js @@ -18,9 +18,7 @@ import { workouts } from "../../data"; import Workout from "./Workout"; class Video extends React.Component { - state = { trophy: false, - achievement: "", - start: false }; + state = { trophy: false, achievement: "", start: false }; finishWorkout = id => { this.props.dispatch({ @@ -43,14 +41,16 @@ class Video extends React.Component { const { classes, todaysWorkouts, workoutList } = this.props; if (this.state.trophy) { return ; - } if(!this.state.start){ - return } - else { + if (!this.state.start) { + return ( + + ); + } else { return ( @@ -61,17 +61,18 @@ class Video extends React.Component { autoPlay src={workoutList[todaysWorkouts[0]].videoUrl} /> - {/* - - {workouts[this.props.workouts[0]].title} - + + + {workouts[this.props.workouts[0]].title} + {workouts[this.props.workouts[0]].description} - */} + {" "} + */} diff --git a/src/components/Video/Workout.js b/src/components/Video/Workout.js index 0128e7f..9a26a25 100644 --- a/src/components/Video/Workout.js +++ b/src/components/Video/Workout.js @@ -1,10 +1,7 @@ import React from "react"; import { Button, - CssBaseline, - Paper, Grid, - Box, Typography, Container } from "@material-ui/core"; import { makeStyles } from '@material-ui/core/styles'; @@ -103,7 +100,7 @@ export default function Workout(props) { > {title} workout - + {description} diff --git a/src/components/Video/styles.js b/src/components/Video/styles.js index 0da0c1b..2566cd4 100644 --- a/src/components/Video/styles.js +++ b/src/components/Video/styles.js @@ -1,4 +1,3 @@ -import { textAlign } from "@material-ui/system"; export default theme => ({ paper: { diff --git a/src/components/login/Login.js b/src/components/login/Login.js index 110e7b4..9261b06 100644 --- a/src/components/login/Login.js +++ b/src/components/login/Login.js @@ -2,8 +2,6 @@ import React, { Component } from "react"; import Button from "@material-ui/core/Button"; import CssBaseline from "@material-ui/core/CssBaseline"; import TextField from "@material-ui/core/TextField"; -import FormControlLabel from "@material-ui/core/FormControlLabel"; -import Checkbox from "@material-ui/core/Checkbox"; import Link from "@material-ui/core/Link"; import Grid from "@material-ui/core/Grid"; import Box from "@material-ui/core/Box"; @@ -12,7 +10,6 @@ import Container from "@material-ui/core/Container"; import { withStyles } from "@material-ui/core/styles"; import styles from "./styles"; import logo from "../../images/logo.png"; -import { Link as Route } from "react-router-dom"; import { users } from "../../data.js"; import request from "superagent"; import { connect } from "react-redux"; diff --git a/src/components/training/Training.js b/src/components/training/Training.js index fc66d03..eea4018 100644 --- a/src/components/training/Training.js +++ b/src/components/training/Training.js @@ -11,7 +11,7 @@ import { withStyles } from "@material-ui/core/styles"; import styles from "./styles"; import Container from "@material-ui/core/Container"; import logo from "../../images/logo.png"; -import { Done, ArrowRight, ArrowLeft } from "@material-ui/icons"; +import { ArrowRight, ArrowLeft } from "@material-ui/icons"; import { Link } from "react-router-dom"; import Trophy from "../trophy/Trophy"; import { connect } from "react-redux"; @@ -76,7 +76,7 @@ class Training extends React.Component {

Time

-

{this.props.workout.totalTime * 0.0001 || "ccc"}

+

{this.props.workout.totalTime * 0.0001}

@@ -86,7 +86,7 @@ class Training extends React.Component { - + {" "} + */} + diff --git a/src/components/training/styles.js b/src/components/training/styles.js index 0da0c1b..5d2b494 100644 --- a/src/components/training/styles.js +++ b/src/components/training/styles.js @@ -1,5 +1,3 @@ -import { textAlign } from "@material-ui/system"; - export default theme => ({ paper: { paddingTop: theme.spacing(2), diff --git a/src/reducers/workout.js b/src/reducers/workout.js index 25d3ab0..eeba486 100644 --- a/src/reducers/workout.js +++ b/src/reducers/workout.js @@ -3,8 +3,10 @@ const reducer = (state = [], action = {}) => { switch (action.type) { case "WORKOUT": - return action.payload.workoutList.find(workout => workout.id == action.payload.trainingId); - // return workouts.find(workout => workout.id == action.payload); + return action.payload.workoutList.find( + workout => workout.id == action.payload.trainingId + ); + // return workouts.find(workout => workout.id == action.payload); default: return state; } diff --git a/src/reducers/workouts.js b/src/reducers/workouts.js new file mode 100644 index 0000000..33c3ea6 --- /dev/null +++ b/src/reducers/workouts.js @@ -0,0 +1,12 @@ +const reducer = (state = initialState, action = {}) => { + switch (action.type) { + case "TODAY_WORKOUTS": + return state.filter(workoutId => workoutId !== action.payload); + default: + return state; + } +}; + +const initialState = [1, 3]; + +export default reducer;